本文介绍了使用 PEAR 安装 phpDocumentor的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http://www.phpdoc.org/ 的主页上,在 http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.quickstart.pkg.html,以及 https://github.com/phpDocumentor/phpDocumentor2,安装 phpDocumentor 的说明如下:

pear channel-discover pear.phpdoc.org梨安装 phpdoc/phpDocumentor

当我这样做时,我发现它已被弃用:

[root@desktop ~]# pear channel-discover pear.phpdoc.org添加频道pear.phpdoc.org"成功发现频道pear.phpdoc.org"成功[root@desktop ~]# pear install PhpDocumentor警告:pear/PhpDocumentor"已被弃用,取而代之的是phpdoc/phpdocumentor"没有下载可选依赖:pear/XML_Beautifier,使用--alldeps自动下载pear/PhpDocumentor 可以选择使用包pear/XML_Beautifier"(版本>= 1.1)正在下载 PhpDocumentor-1.4.4.tgz ...开始下载 PhpDocumentor-1.4.4.tgz (1,534,088 字节)................................................................................................................................................................................................................................................................................................................................完成:1,534,088 字节安装好:channel://pear.php.net/PhpDocumentor-1.4.4[root@desktop ~]# pear 卸载 PhpDocumentor卸载确定: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 的首选方式是什么?

解决方案
sudo apt-get install php-pearsudo pear 频道更新 pear.php.netsudo pear upgrade-all

安装php文档

sudo pear channel-discover pear.phpdoc.orgsudo pear 远程列表 -c phpdocsudo pear config-set data_dir/var/wwwsudo pear install --alldeps PhpDocumentor须藤梨安装 phpdoc/phpDocumentorsudo mkdir/var/www/PhpDocumentor-输出sudo chown www-data/var/www/PhpDocumentor-output

安装 phpmd

sudo pear channel-discover pear.phpmd.orgsudo pear 远程列表 -c phpmd须藤梨安装 phpmd/PHP_PMD

安装代码嗅探器

sudo pear install PHP_CodeSniffer

安装phpdepend

sudo pear channel-discover pear.pdepend.orgsudo pear 远程列表 -c pdependsudo pear install pdepend/PHP_Depend

检查所有梨包

sudo pear list all

其他有用的命令

sudo pear upgrade-all

安装 phpunit 测试

sudo apt-get install phpunit

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?

解决方案
sudo apt-get install php-pear
sudo pear channel-update pear.php.net
sudo pear upgrade-all
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
sudo pear channel-discover pear.phpmd.org
sudo pear remote-list -c phpmd
sudo pear install phpmd/PHP_PMD
sudo pear install PHP_CodeSniffer
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
sudo apt-get install phpunit

这篇关于使用 PEAR 安装 phpDocumentor的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-30 09:10