Installing phpDocumentor using PEAR

帅比萌擦擦* 提交于 2019-12-07 16:48:24

问题


On the home page of http://www.phpdoc.org/, on http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.quickstart.pkg.html, and on https://github.com/phpDocumentor/phpDocumentor2, instructions to install phpDocumentor are:

pear channel-discover pear.phpdoc.org
pear install phpdoc/phpDocumentor

When I do so, I see that it is deprecated:

[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

According to http://www.phpdoc.org/docs/latest/for-users/installation/using-pear.html#requirements, instructions are:

$ pear install phpdoc/phpDocumentor-beta

Which is the preferred way to install phpDocumentor using PEAR?


回答1:


To install PEAR

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

To install 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 

To Install phpmd

sudo pear channel-discover pear.phpmd.org 
sudo pear remote-list -c phpmd 
sudo pear install phpmd/PHP_PMD 

To install codesniffer

sudo pear install PHP_CodeSniffer 

To install phpdepend

sudo pear channel-discover pear.pdepend.org 
sudo pear remote-list -c pdepend 
sudo pear install pdepend/PHP_Depend

To check all pear packages

sudo pear list all 

other useful commands

sudo pear upgrade-all 

to install phpunit test

sudo apt-get install phpunit 



回答2:


I think the actual reason for that "deprecated" message you got was that you ran --

pear install phpdocumentor

without including the server alias of "phpdoc/" -- pear install phpdoc/phpdocumentor

No alias means the default alias of pear/ got used, thus pear install pear/phpdocumentor

That's why it gave you the 1.x version, hosted from PEAR. Notice that in your output:

[root@desktop ~]# pear install PhpDocumentor
WARNING: "pear/PhpDocumentor" is deprecated in favor of "phpdoc/phpdocumentor"

To get the 2.x version hosted at phpdoc.org, you must use the phpdoc/ alias -- pear install phpdoc/phpdocumentor

The capital D doesn't matter, and the -beta doesn't matter.




回答3:


I think regarding to the erro message the PhpDocumentor should be installed by:

pear install phpdoc/phpdocumentor

(mind the small d).



来源:https://stackoverflow.com/questions/20518713/installing-phpdocumentor-using-pear

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!