• [Ubuntu] Yii API manual for Vim


    I found a good plugin for vim, that is Yii API manual for Vim, which you can check 

    the api in vim!

    here is the website: https://github.com/vim-scripts/Yii-API-manual-for-Vim

    But that, why i write this article is that, when i Creatting custom version follows:

    git clone https://github.com/yiisoft/yii.git /media/My_Documents/htdocs/yii
    cd /media/My_Documents/htdocs/yii/build
    
    export YII_CONSOLE_COMMANDS=/path/to/yii-api-vim/yii_commands/
    ./build vimapi /media/My_Documents/htdocs/yii/docs

    I got these errors: 

    Building.. : Yii Framework Class Reference for vim
    Version... : 1.1.14-dev
    Source URL : http://code.google.com/p/yii/source/browse/trunk/framework
    
    Building model...
    PHP Error[2]: require_once(PHPUnit/Runner/Version.php): failed to open stream: No such file or directory
        in file /media/My_Documents/htdocs/yii/framework/test/CTestCase.php at line 11
    #0 /media/My_Documents/htdocs/yii/framework/test/CTestCase.php(11): require_once()
    #1 /media/My_Documents/htdocs/yii/framework/YiiBase.php(395): include()
    #2 unknown(0): autoload()
    #3 /media/My_Documents/htdocs/yii/framework/test/CDbTestCase.php(41): spl_autoload_call()
    #4 /media/My_Documents/htdocs/yii/build/commands/api/ApiModel.php(35): require_once()
    #5 /media/My_Documents/htdocs/yii/build/commands/api/ApiModel.php(26): ApiModel->findClasses()
    #6 /home/davidhhuan/.vim/bundle/Yii-API-manual-for-Vim/yii_commands/VimApiCommand.php(139): ApiModel->build()
    #7 /home/davidhhuan/.vim/bundle/Yii-API-manual-for-Vim/yii_commands/VimApiCommand.php(126): VimApiCommand->buildModel()
    #8 /media/My_Documents/htdocs/yii/framework/console/CConsoleCommandRunner.php(67): VimApiCommand->run()
    #9 /media/My_Documents/htdocs/yii/framework/console/CConsoleApplication.php(91): CConsoleCommandRunner->run()
    #10 /media/My_Documents/htdocs/yii/framework/base/CApplication.php(169): CConsoleApplication->processRequest()
    #11 /media/My_Documents/htdocs/yii/framework/yiic.php(33): CConsoleApplication->run()
    #12 /media/My_Documents/htdocs/yii/build/build(17): require_once()
    davidhhuan@davidhhuan-ThinkPad-T410:/media/My_Documents/htdocs/yii/build$ pear install phpunit/PHPUnit
    Attempting to discover channel "phpunit"...
    downloading channel.xml ...
    Starting to download channel.xml (1 bytes)
    ....done: 1 bytes
    unknown channel "phpunit" in "phpunit/PHPUnit"
    invalid package name/package file "phpunit/PHPUnit"
    install failed

    My system is Ubuntu 12.04

    that means i have NOT installed the PHPUnit, then i install the PHPUnit

    sudo apt-get install phpunit

    after that, i re-run this command:

    ./build vimapi /media/My_Documents/htdocs/yii/docs

    again, this time i got these errors:

    Building.. : Yii Framework Class Reference for vim
    Version... : 1.1.14-dev
    Source URL : http://code.google.com/p/yii/source/browse/trunk/framework
    
    Building model...
    PHP Error[2]: require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory
        in file /usr/share/php/PHPUnit/Autoload.php at line 46
    #0 /usr/share/php/PHPUnit/Autoload.php(46): require_once()
    #1 /media/My_Documents/htdocs/yii/framework/test/CTestCase.php(15): require_once()
    #2 /media/My_Documents/htdocs/yii/framework/YiiBase.php(395): include()
    #3 unknown(0): autoload()
    #4 /media/My_Documents/htdocs/yii/framework/test/CDbTestCase.php(41): spl_autoload_call()
    #5 /media/My_Documents/htdocs/yii/build/commands/api/ApiModel.php(35): require_once()
    #6 /media/My_Documents/htdocs/yii/build/commands/api/ApiModel.php(26): ApiModel->findClasses()
    #7 /home/davidhhuan/.vim/bundle/Yii-API-manual-for-Vim/yii_commands/VimApiCommand.php(139): ApiModel->build()
    #8 /home/davidhhuan/.vim/bundle/Yii-API-manual-for-Vim/yii_commands/VimApiCommand.php(126): VimApiCommand->buildModel()
    #9 /media/My_Documents/htdocs/yii/framework/console/CConsoleCommandRunner.php(67): VimApiCommand->run()
    #10 /media/My_Documents/htdocs/yii/framework/console/CConsoleApplication.php(91): CConsoleCommandRunner->run()
    #11 /media/My_Documents/htdocs/yii/framework/base/CApplication.php(169): CConsoleApplication->processRequest()
    #12 /media/My_Documents/htdocs/yii/framework/yiic.php(33): CConsoleApplication->run()
    #13 /media/My_Documents/htdocs/yii/build/build(17): require_once()

    ok, follow these steps:

    sudo pear channel-discover pear.phpunit.de
    sudo pear channel-discover components.ez.no
    sudo pear install phpunit/PHP_CodeCoverage

    after that, i re-run this command:

    ./build vimapi /media/My_Documents/htdocs/yii/docs

    now, i got these errors...

    Building.. : Yii Framework Class Reference for vim
    Version... : 1.1.14-dev
    Source URL : http://code.google.com/p/yii/source/browse/trunk/framework
    
    Building model...
    PHP Fatal error:  Call to undefined method PHP_CodeCoverage_Filter::getInstance() in /usr/share/php/PHPUnit/Autoload.php on line 64

    Damn... After searching and trying for serveal methods from google, i still blocked here, then i try to modify the file /usr/share/php/PHPUnit/Autoload.php, add 

    these codes to it:

    private static $_self = null;
    public static function getInstance()
    {
        if (self::$_self==null)
        {
            self::$_self = new PHP_CodeCoverage_Filter;
        }
        return self::$_self;
    }

    and then i modify the file, /etc/php5/cli/php.ini, uncommend this line:

    include_path = ".:/usr/share/php"

    then i re-try:

    ./build vimapi /media/My_Documents/htdocs/yii/docs

    yes, again, i got new errors:

    Building.. : Yii Framework Class Reference for vim
    Version... : 1.1.14-dev
    Source URL : http://code.google.com/p/yii/source/browse/trunk/framework
    
    Building model...
    PHP Error[2]: require_once(PHPUnit/Extensions/SeleniumTestCase.php): failed to open stream: No such file or directory
        in file /media/My_Documents/htdocs/yii/framework/test/CWebTestCase.php at line 12
    #0 /media/My_Documents/htdocs/yii/framework/test/CWebTestCase.php(12): require_once()
    #1 /media/My_Documents/htdocs/yii/build/commands/api/ApiModel.php(35): require_once()
    #2 /media/My_Documents/htdocs/yii/build/commands/api/ApiModel.php(26): ApiModel->findClasses()
    #3 /home/davidhhuan/.vim/bundle/Yii-API-manual-for-Vim/yii_commands/VimApiCommand.php(139): ApiModel->build()
    #4 /home/davidhhuan/.vim/bundle/Yii-API-manual-for-Vim/yii_commands/VimApiCommand.php(126): VimApiCommand->buildModel()
    #5 /media/My_Documents/htdocs/yii/framework/console/CConsoleCommandRunner.php(67): VimApiCommand->run()
    #6 /media/My_Documents/htdocs/yii/framework/console/CConsoleApplication.php(91): CConsoleCommandRunner->run()
    #7 /media/My_Documents/htdocs/yii/framework/base/CApplication.php(169): CConsoleApplication->processRequest()
    #8 /media/My_Documents/htdocs/yii/framework/yiic.php(33): CConsoleApplication->run()
    #9 /media/My_Documents/htdocs/yii/build/build(17): require_once()

    ok, i download the PHPUnit_Selenium from http://pear.phpunit.de/, uncompress it and copy the folder PHPUnit to /usr/share/php

    then i re-try:

    ./build vimapi /media/My_Documents/htdocs/yii/docs

    then....

    Building.. : Yii Framework Class Reference for vim
    Version... : 1.1.14-dev
    Source URL : http://code.google.com/p/yii/source/browse/trunk/framework
    
    Building model...
    Building help files...
    Done.

    Thanks goodsness!!! I done it!!!

    BTW, If you want to use keyword search (which allows to press <S-k> over any keyword) then you should add this line to your .vimrc:

    autocmd BufNewFile,Bufread *.php set keywordprg="help"

    Have fun with Yii and vim!!!

  • 相关阅读:
    《分析服务从入门到精通读书笔记》第四章、维度部署浏览篇(3)
    集群(cluster)原理(转)
    Atitit 前端测试最简化内嵌web服务器 php 与node.js 目录 1.1. php内置Web Server 1 1.2. Node的 2 Node的比较麻烦些。。Php更加简单
    Atitit mybatis使用简明教程 目录 1.1. Mybatis.xml 配置文件 1 1.2. Datamp.xml mapper文件主要作用是分模块放sql语句 2 1.3. 查询
    Atitit 业务流程执行引擎的实现 目录 1.1. 引擎实现语言java js php等 1 1.2. 流程语言 xml sql js等 业务流程定义语言规范总结 1 1.3. 实体方法定义 2
    Atitit 常见软件设计图纸总结 目录 1.1. ui原型图与html 2 1.2. 业务逻辑 伪代码 各种uml图 2 1.3. 总体设计图纸 结构图 层次图 架构图 2 1.4. 业务逻辑
    Atitit velocity 模板引擎使用法 目录 1.1. 1.4 Context 1 1.1.1. 1.4.1 Context 基本概念 1 1.2. .3不同模式下使用velocity 1
    Atitit mysql存储过程编写指南 1. 定义变量 1 1.1. 变量名以@开头用户变量 会话变量 1 1.2. 以declare关键字声明 存储过程变量 2 1.3. @是用户自定义变量,
    Atitit 算法的艺术 attilax艾提拉著v7 t88.docx Atitit 算法之道 attilax著 1. 文本方面的编码算法 3 1.1. Base64 htmlencode url
    Atitt 常见的拖欠费用的公司与个人黑名单 陕西西部安全网 20072008 西安 一个月 25000 西安盛世涅槃 2007 西安 1m 25000 Sicyi msc 2007 n
  • 原文地址:https://www.cnblogs.com/davidhhuan/p/2857301.html
Copyright © 2020-2023  润新知