在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的首选方式是哪种?
安装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
安装代码嗅探器
sudo pear install PHP_CodeSniffer
安装phpdependent
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测试
sudo apt-get install phpunit
我认为您收到"弃用"消息的实际原因是您运行了
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不重要,β也不重要。
我认为关于错误消息,PhpDocumentor应该由安装
pear install phpdoc/phpdocumentor
(注意小的d)。