Installing phpDocumentor using PEAR

6.1k views Asked by At

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?

3

There are 3 answers

2
amarjit singh On BEST ANSWER

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 
1
ashnazg On

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.

2
shadyyx On

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

pear install phpdoc/phpdocumentor

(mind the small d).