在http://www.phpdoc.org/,http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.quickstart.pkg.html和https://github.com/phpDocumentor/phpDocumentor2的主页上,安装phpDocumentor的说明如下:
pear channel-discover pear.phpdoc.org
pear install phpdoc/phpDocumentor
当我这样做时,我发现它已被弃用:
[root@desktop ~]# pear channel-discover pear.phpdoc.org
Adding Channel "pear.phpdoc.org" succeeded
Discovery of channel "pear.phpdoc.org" succeeded
[root@desktop ~]# pear install PhpDocumentor
WARNING: "pear/PhpDocumentor" is deprecated in favor of "phpdoc/phpdocumentor"
Did not download optional dependencies: pear/XML_Beautifier, use --alldeps to download automatically
pear/PhpDocumentor can optionally use package "pear/XML_Beautifier" (version >= 1.1)
downloading PhpDocumentor-1.4.4.tgz ...
Starting to download PhpDocumentor-1.4.4.tgz (1,534,088 bytes)
..............................................................................................................................................................................................................................................................................................................done: 1,534,088 bytes
install ok: channel://pear.php.net/PhpDocumentor-1.4.4
[root@desktop ~]# pear uninstall PhpDocumentor
uninstall ok: channel://pear.php.net/PhpDocumentor-1.4.4
根据http://www.phpdoc.org/docs/latest/for-users/installation/using-pear.html#requirements,说明是:
$ pear install phpdoc/phpDocumentor-beta
使用PEAR安装phpDocumentor的首选方法是什么?
答案 0 :(得分:6)
安装PEAR
sudo apt-get install php-pear
sudo pear channel-update pear.php.net
sudo pear upgrade-all
安装php doc
sudo pear channel-discover pear.phpdoc.org
sudo pear remote-list -c phpdoc
sudo pear config-set data_dir /var/www
sudo pear install --alldeps PhpDocumentor
sudo pear install phpdoc/phpDocumentor
sudo mkdir /var/www/PhpDocumentor-output
sudo chown www-data /var/www/PhpDocumentor-output
安装phpmd
sudo pear channel-discover pear.phpmd.org
sudo pear remote-list -c phpmd
sudo pear install phpmd/PHP_PMD
安装codeniffer
sudo pear install PHP_CodeSniffer
安装phpdepend
sudo pear channel-discover pear.pdepend.org
sudo pear remote-list -c pdepend
sudo pear install pdepend/PHP_Depend
检查所有梨包
sudo pear list all
其他有用的命令
sudo pear upgrade-all
安装phpunit test
sudo apt-get install phpunit
答案 1 :(得分:3)
我认为你得到的“弃用”消息的实际原因是你跑了 -
pear install phpdocumentor
不包含服务器别名“phpdoc /” - pear install phpdoc/phpdocumentor
没有别名意味着使用了pear/
的默认别名,因此pear install pear/phpdocumentor
这就是为什么它为您提供了由PEAR托管的1.x版本。请注意,在输出中:
[root@desktop ~]# pear install PhpDocumentor
WARNING: "pear/PhpDocumentor" is deprecated in favor of "phpdoc/phpdocumentor"
要获得在phpdoc.org上托管的2.x版本,您必须使用phpdoc/
别名 - pear install phpdoc/phpdocumentor
首都D并不重要,-beta并不重要。
答案 2 :(得分:0)
我认为关于错误消息,应该通过以下方式安装PhpDocumentor:
pear install phpdoc/phpdocumentor
(请注意小 d )。