dongxi2014 2016-03-17 02:00
浏览 113
已采纳

什么是PHP CI构建路径

I've successfully installed PHPCI on my local server, setup a project, and run my first build.

Even without a phpci.yml, PHP CI seems to detect my Codeception tests (yay!)

However, the build log contains the following text

Exception: Warning: file_get_contents(/tests/_output/report.tap.log): failed to open stream: No such file or directory in /path/to/Sites/php-ci/phpci/PHPCI/Plugin/Codeception.php line 94 PLUGIN: FAILED

When I take a look at line 94, I see the following

$tapString = file_get_contents(
    $this->phpci->buildPath . $this->logPath . DIRECTORY_SEPARATOR . 'report.tap.log'
);

PHPCI seems to be building a path with the $this->phpci->buildPath.

What is this path? Is it the PHP CI path? The path of my repository? A third working area that can be anywhere?

Where in PHP CI do I set this path? Per project in the phpci.yml? Somewhere in the admin?

  • 写回答

1条回答 默认 最新

  • duandie0884 2017-02-21 02:36
    关注

    I've found your question on my search for answers regarding PHPCI.

    I don't know if you still need your answer, but I'll post it for anyone else who's wondering.

    To answer your questions:

    • "What is this path?" It's a uniquely generated path for each build.
    • "Is it the PHP CI path?" No
    • "The path of my repository?" No
    • "A third working area that can be anywhere?" Not exactly anywhere, but yes.

    "Where in PHP CI do I set this path?"
    Well, to answer that I dug deeper into their source code and I found, that the original path is set up by the following PHP Code:

     $buildDirectory = $this->getId() . '_' . substr(md5(microtime(true)), 0, 5);
     $this->currentBuildPath = PHPCI_BUILD_ROOT_DIR . $buildDirectory . DIRECTORY_SEPARATOR;
    

    The generated path would therefore be the builds' ID and a (more or less) unique part. Important here is the defined constant PHPCI_BUILD_ROOT_DIR which is defined in the file vars.php in your installation directory:

    // Define PHPCI_BUILD_ROOT_DIR
    if (!defined('PHPCI_BUILD_ROOT_DIR')) {
        define('PHPCI_BUILD_ROOT_DIR', PHPCI_DIR . 'PHPCI/build/');
    }
    

    So the directory would by default be a temporary folder called
    path/to/phpci/PHPCI/build/4_31370/

    This folder will of course be deleted again, as soon as the build is finished.

    I've then changed the definition of the folder to
    define('PHPCI_BUILD_ROOT_DIR', PHPCI_DIR . 'tempbuilddir/');
    which gives me the following build temporary build directory:
    path/to/phpci/tempbuilddir/6_65873/

    So this directory is completely customizable.

    Nevertheless the Codeception plugin seems to have changed since your version, as the filename report.tap.log doesn't appear to be in the source code anymore.

    I hope this answer gave you an understanding of the PHPCI build directory configuration. It certainly helped me to find this out.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥60 pb数据库修改或者求完整pb库存系统,需为pb自带数据库
  • ¥15 spss统计中二分类变量和有序变量的相关性分析可以用kendall相关分析吗?
  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路