3

在http://www.phpdoc.org/的主页上,在http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.quickstart.pkg.htmlhttps://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 的首选方式是什么?

4

3 回答 3

6

安装梨

sudo apt-get install php-pear 
sudo pear channel-update pear.php.net 
sudo pear upgrade-all 

安装 php 文档

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 

安装 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 测试

sudo apt-get install phpunit 
于 2013-12-11T12:26:18.937 回答
3

我认为您收到“已弃用”消息的实际原因是您运行了-

pear install phpdocumentor

不包括“phpdoc/”的服务器别名——pear install phpdoc/phpdocumentor

No alias 表示pear/got used 的默认别名,因此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 也无关紧要。

于 2013-12-11T16:47:53.590 回答
0

我认为关于错误消息,应该通过以下方式安装 PhpDocumentor:

pear install phpdoc/phpdocumentor

(注意小d)。

于 2013-12-11T12:33:01.437 回答