如何使用 PEAR 安装程序完全删除 PHPUnit?

发布于 2024-12-25 12:34:27 字数 725 浏览 0 评论 0原文

几天前,我使用 PEAR 安装程序安装了 PHPUnit(我还安装了 Selenium RC 用于 PHP 测试)。现在我想卸载它(同时删除所有相关的文件夹和文件)

我运行了以下命令:

pear uninstall phpunit/PHPUnit

控制台显示:

phpunit/PHPUnit not installed

我检查了 PHPUnit 文件夹,它仍然存在吗?

是不是被卸载了?我尝试重新安装新的 PHPUnit,但控制台显示:

No releases available for package "pear.phpunit.de/PHPUnit"

How can I reinstall it?


以下是 pear list -c pear.phpunit.de 的输出:

pear list -c pear.phpunit .de

这是 pear list -c pear.phpunit.de 的输出:

pear列表-c pear.phpunit.de

I installed PHPUnit using the PEAR installer a few days ago (I also installed Selenium RC for testing in PHP purpose). Now I want to uninstall it (also delete all related folders and files)

I ran the following command:

pear uninstall phpunit/PHPUnit

and the console displayed:

phpunit/PHPUnit not installed

I checked the PHPUnit folder, it was still there?

Was it uninstalled? I try to reinstall a new PHPUnit, but the console displayed:

No releases available for package "pear.phpunit.de/PHPUnit"

How can I reinstall it?


Here's the output of pear list -c pear.phpunit.de:

pear list -c pear.phpunit.de

Here's output of pear list -c pear.phpunit.de:

pear list -c pear.phpunit.de

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

许久 2025-01-01 12:34:27

我检查了 PHPUnit 文件夹,它还在吗?

这可能是因为子组件(扩展、框架)。不过你不必担心这一点。

要安装最新版本,请执行以下两个命令:

> pear config-set auto_discover 1
config-set succeeded

> pear upgrade
...

这将需要一些时间,并将更新当前安装的所有内容。由于您已经有一些可用的扩展,并且最新版本的 PHPUnit 可能需要这些扩展,因此请更新它们以防止下一个命令失败:

> pear install pear.phpunit.de/PHPUnit

现在应该安装它:

Did not download optional dependencies: phpunit/PHP_Invoker, use --alldeps to download automatically
phpunit/PHPUnit can optionally use package "phpunit/PHP_Invoker" (version >= 1.0.0)
downloading PHPUnit-3.6.7.tgz ...
Starting to download PHPUnit-3.6.7.tgz (118,349 bytes)
..........................done: 118,349 bytes
install ok: channel://pear.phpunit.de/PHPUnit-3.6.7

PEAR 故障排除

正如您在评论中报告的那样,这没有成功。大概梨子处于一种不知道上下在哪里的状态吧。是时候给力了。首先,清除缓存:

> pear clear-cache
reading directory C:\...\Temp\pear\cache
0 cache entries cleared

然后强制频道更新:

> pear channel-update -f pear.php.net
Updating channel "pear.php.net"
Update of Channel "pear.php.net" succeeded

> pear channel-update -f pear.phpunit.de
Updating channel "pear.phpunit.de"
Update of Channel "pear.phpunit.de" succeeded

然后强制安装 phpunit:

> pear install -a -f phpunit/PHPUnit

I checked the PHPUnit folder, it was still there?

That might be because of sub-components (Extensions, Framework). However you must not be concerned about that.

To install the latest version, do the following two commands:

> pear config-set auto_discover 1
config-set succeeded

> pear upgrade
...

This will take some time, and will update all that is currently installed. As you have some extensions already available and the latest version of PHPUnit might require those, so update them to prevent failure in the next command:

> pear install pear.phpunit.de/PHPUnit

This should now install it:

Did not download optional dependencies: phpunit/PHP_Invoker, use --alldeps to download automatically
phpunit/PHPUnit can optionally use package "phpunit/PHP_Invoker" (version >= 1.0.0)
downloading PHPUnit-3.6.7.tgz ...
Starting to download PHPUnit-3.6.7.tgz (118,349 bytes)
..........................done: 118,349 bytes
install ok: channel://pear.phpunit.de/PHPUnit-3.6.7

Troubleshooting PEAR

As you reported in comments, this did not work out. Probably pear is in a state that it does not know where top and bottom is. Time to force. First, clear the cache:

> pear clear-cache
reading directory C:\...\Temp\pear\cache
0 cache entries cleared

Then force channel updates:

> pear channel-update -f pear.php.net
Updating channel "pear.php.net"
Update of Channel "pear.php.net" succeeded

> pear channel-update -f pear.phpunit.de
Updating channel "pear.phpunit.de"
Update of Channel "pear.phpunit.de" succeeded

Then force the phpunit install:

> pear install -a -f phpunit/PHPUnit
触ぅ动初心 2025-01-01 12:34:27

由于谷歌将这个问题称为“如何删除它”,因此回答这个问题似乎很重要。

作为 root,使用:

pear list -c phpunit | grep stable | awk '{print "phpunit/"$1}' | xargs pear uninstall

此处找到这个答案

As Google referenced this question as "how to REMOVE it", it seems important to answer the question.

As root, use:

pear list -c phpunit | grep stable | awk '{print "phpunit/"$1}' | xargs pear uninstall

Found this answer here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文