【问题标题】:How do I build my own phar archive for PHPUnit?如何为 PHPUnit 构建自己的 phar 存档?
【发布时间】:2014-03-13 06:59:27
【问题描述】:

我已经从 Github 下载了当前版本的 PHPUnit,并做了一个小的定制。我现在想为它创建自己的 phar 存档。我看到有a build.xml file included with PHPUnit that looks like it contains the directives needed for creation of the phar archive,但是在阅读了 phar 之后,我仍然不清楚使用 PHPUnit 实现它的命令是什么。任何建议表示赞赏!

【问题讨论】:

    标签: phpunit phar


    【解决方案1】:

    克隆存储库。我猜你已经有了这个,但还没有完成

    $ git clone https://github.com/sebastianbergmann/phpunit

    换成它

    $ cd phpunit

    build.xml 文件意味着(大部分)Ant 被用作构建管理系统。要弄清楚项目 (-p) 提供了哪些目标,只需询问 ant 本身:

    $ ant -p

    那么你应该得到这个输出:

    Buildfile: /private/tmp/phpunit/build.xml
    
    Main targets:
    
    clean       Cleanup build artifacts
    composer    Install dependencies with Composer
    pdepend     Calculate software metrics using PHP_Depend
    pear        Create PEAR package of PHPUnit and all its dependencies (release)
    phar        Create PHAR archive of PHPUnit and all its dependencies (release)
    phar-alpha  Create PHAR archive of PHPUnit and all its dependencies (alpha)
    phar-beta   Create PHAR archive of PHPUnit and all its dependencies (beta)
    phpab       Generate autoloader script
    phpcpd      Find duplicate code using PHPCPD
    phpcs       Find coding standard violations using PHP_CodeSniffer
    phpcs-ci    Find coding standard violations using PHP_CodeSniffer
    phpdox      Generate software project documentation using phpDox
    phploc      Measure project size using PHPLOC
    phpmd       Perform project mess detection using PHPMD
    phpmd-ci    Perform project mess detection using PHPMD
    phpunit     Run unit tests with PHPUnit
    prepare     Prepare for build
    
    Default target: build
    

    剩下的很简单——只需输入

    $ ant phar

    该任务将安装 Composer(即使您已经拥有它,但将其复制到当前文件夹中)并下载所有依赖项。

    【讨论】:

      猜你喜欢
      • 2011-02-11
      • 1970-01-01
      • 2013-10-31
      • 2014-04-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多