【问题标题】:Stagehand module withought PEAR带 PEAR 的舞台手模块
【发布时间】:2011-01-28 07:51:20
【问题描述】:
我想创造环境。
CakePHP + Hudson CI 环境。
但。我没有安装 PEAR 的特权
所以我在 vendor/pear/Stagehand 上设置了 Stagehand 模块
但那是行不通的。 :-
require_once(Stagehand/Autoload.php): failed to open stream: No such file or directory
php -d include_path=./:$CAKE/vendors/pear/PEAR/ ./vendors/pear/bin/cakerunner --cakephp-app-path $CAKE/app --log-junit=$CAKE/app/tmp/logs/unittest.xml -R $CAKE/app/tests/cases
Fatal error: Class 'Stagehand_TestRunner_Runner_RunnerFactory' not found
你有什么解决办法吗?
【问题讨论】:
标签:
cakephp
hudson
cakephp-1.3
pear
continuous-integration
【解决方案1】:
:$CAKE/vendors/pear/PEAR/ 可能是错误的。我猜Stagehand/Autoload.php 文件安装在vendors/pear/Stagehand/Autoload.php 中。在这种情况下,使用
-d include_path=./:$CAKE/vendors/pear/
【解决方案2】:
我建议 PHP 应用程序使用特定于项目的 PEAR 环境。在您的情况下,您的项目可以包括 PEAR 基础系统和所需的软件包,如下所示:
- vendors/pear/PEAR.php
- vendors/pear/bin/cakerunner
- vendors/pear/Stagehand
- 供应商/梨/...
或
在引入项目特定的 PEAR 环境后,您可以将路径指定到预加载脚本中:
set_include_path('/path/to/project/vendors/pear');
最后,将运行测试的命令行编辑为:
/path/to/php /path/to/project/vendors/pear/bin/cakerunner -p /path/to/preload.php --cakephp-app-path=/path/to/project/app --cakephp-core-path=/path/to/project/cake ...
This manual page 解释了如何为您的项目构建项目特定的 PEAR 环境。