문제

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?

도움이 되었습니까?

해결책

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 

다른 팁

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.

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

pear install phpdoc/phpdocumentor

(mind the small d).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top