【问题标题】:Could not open input file: bin/codecept无法打开输入文件:bin/codecept
【发布时间】:2017-02-24 17:01:50
【问题描述】:

我正在尝试按照此处的步骤在 symfony 3 框架上安装 codeception:

http://codeception.com/for/symfony

当我跑步时

php bin/codecept bootstrap --empty

我收到错误

无法打开输入文件:bin/codecept

我尝试以管理员身份在 Windows 命令行上安装它。

但是从输出看来,由于警告,bin 目录中的文件 codecept 没有被创建:

E:\projektai\php projektai\htdocs\timetracker>composer require codeception/codec
eption --dev
Warning: This development build of composer is over 60 days old. It is recommend
ed to update it by running "C:\ProgramData\Composer\bin\composer.phar self-updat
e" to get the latest version.
Using version ^2.2 for codeception/codeception
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
> Incenteev\ParameterHandler\ScriptHandler::buildParameters
Updating the "app/config/parameters.yml" file
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache

 // Clearing the cache for the dev environment with debug
 // true

 [OK] Cache for the "dev" environment (debug=true) was successfully cleared.

> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets

 Trying to install assets as relative symbolic links.

 --------- ----------------- ------------------
            Bundle            Method / Error
 --------- ----------------- ------------------
  WARNING   FrameworkBundle   absolute symlink
 --------- ----------------- ------------------

 [OK] All assets were successfully installed.

> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFi
le
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::prepareDeploymentTarg
et

在这种情况下如何使用代码接收?

【问题讨论】:

    标签: symfony cmd codeception


    【解决方案1】:

    在尝试了更多之后发现我可以通过这种方式运行该命令:

    php vendor/codeception/codeception/codecept bootstrap --empty
    

    按照说明将其添加到 bin 文件夹中仍然会很好。

    【讨论】:

    • 不是vendor/bin/codecept吗? Windows 用户还应该有一个 codecept.bat 文件。
    【解决方案2】:

    将 codecept 文件从 vendor(vendor/codeception/codeception/codecept) 复制到 bin 目录并将 require_once 行更改为:

    require_once __DIR__.'/../vendor/autoload.php';
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-04-21
      • 1970-01-01
      • 1970-01-01
      • 2021-07-16
      • 2014-01-13
      • 2015-12-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多