我正在为我的项目配置 Jenkins,我想创建 phpdoc,但它不起作用。我正在使用 phing 并且我的服务器使用 Debian。
我做了什么:
安装 phpDoc
pear install phpdoc/phpDocumentor-beta
平:
<target name="phpdoc"> <phpdoc2 destdir="${workspace}/app/docs" template="responsive"> <fileset dir="./src"> <include name="**.*.php" /> </fileset> </phpdoc2> </target>
我收到此错误:
PHP Fatal error: Call to undefined method phpDocumentor\Parser\Parser::setTitle() in /usr/share/php/phing/tasks/ext/phpdoc/PhpDocumentor2Wrapper.php on line 169
PHP Stack trace:
PHP 1. {main}() /usr/share/php/phing.php:0
PHP 2. Phing::fire() /usr/share/php/phing.php:43
PHP 3. Phing::start() /usr/share/php/phing/Phing.php:270
PHP 4. Phing->runBuild() /usr/share/php/phing/Phing.php:170
PHP 5. Project->executeTargets() /usr/share/php/phing/Phing.php:572
PHP 6. Project->executeTarget() /usr/share/php/phing/Project.php:791
PHP 7. Target->performTasks() /usr/share/php/phing/Project.php:818
PHP 8. Target->main() /usr/share/php/phing/Target.php:321
PHP 9. Task->perform() /usr/share/php/phing/Target.php:298
PHP 10. PhingCallTask->main() /usr/share/php/phing/Task.php:260
PHP 11. PhingTask->main() /usr/share/php/phing/tasks/system/PhingCallTask.php:158
PHP 12. PhingTask->processFile() /usr/share/php/phing/tasks/system/PhingTask.php:150
PHP 13. Project->executeTarget() /usr/share/php/phing/tasks/system/PhingTask.php:277
PHP 14. Target->performTasks() /usr/share/php/phing/Project.php:818
PHP 15. Target->main() /usr/share/php/phing/Target.php:321
PHP 16. Task->perform() /usr/share/php/phing/Target.php:298
PHP 17. PhpDocumentor2Task->main() /usr/share/php/phing/Task.php:260
PHP 18. PhpDocumentor2Wrapper->run() /usr/share/php/phing/tasks/ext/phpdoc/PhpDocumentor2Task.php:147
PHP 19. PhpDocumentor2Wrapper->parseFiles() /usr/share/php/phing/tasks/ext/phpdoc/PhpDocumentor2Wrapper.php:201
Build step 'Invoke Phing targets' marked build as failure
似乎找不到 phpDocumentor 类,但我找不到原因!
我的包含路径是 .:/usr/share/php:/usr/share/pear 并且 phpDocumentor 安装在 /usr/share/pear 文件夹中。
有任何想法吗 ?
编辑:我创建了一个简单的测试文件:
# cat test.php
<?php
$parser = new \phpDocumentor\Parser\Parser();
但我得到这个错误:
# php -f test.php
PHP Fatal error: Class 'phpDocumentor\Parser\Parser' not found in /var/www/test.php on line 2
PHP Stack trace:
PHP 1. {main}() /var/www/test.php:0
为什么我已经安装了 phpDocumentor 接缝:
pear info phpdoc/phpDocumentor
About pear.phpdoc.org/phpDocumentor-2.0.0
=========================================
Release Type PEAR-style PHP-based Package
Name phpDocumentor
Channel pear.phpdoc.org
[...]
Release Date 2013-08-03 06:08:35
Release Version 2.0.0 (stable)
API Version 2.0.0 (stable)
package.xml version 2.0
Last Modified 2013-08-06 08:17
Previous Installed - None -
Version