phpcentospearphpdocphpdocumentor2

Installing phpDocumentor using PEAR


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?


Solution

  • 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