使用 PEAR 安装 phpDocumentor

2024-04-13php开发问题
6

本文介绍了使用 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 的首选方式是什么?

解决方案

安装 PEAR

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?

解决方案

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 

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

The End

相关推荐

PHP实现DeepL翻译API调用
DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以...
2025-08-20 php开发问题
168

PHP通过phpspreadsheet导入Excel日期数据处理方法
PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的...
2024-10-23 php开发问题
287

mediatemple - 无法使用 codeigniter 发送电子邮件
mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)...
2024-08-23 php开发问题
11

Laravel Gmail 配置错误
Laravel Gmail Configuration Error(Laravel Gmail 配置错误)...
2024-08-23 php开发问题
16

将 PHPMailer 用于 SMTP 的问题
Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)...
2024-08-23 php开发问题
4

关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题
Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)...
2024-08-23 php开发问题
17