windows 如何使用 PEAR 安装程序完全删除 PHPUnit?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8739894/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I remove completely PHPUnit using the PEAR Installer?
提问by Leo Lerdorf
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)
几天前我使用 PEAR 安装程序安装了 PHPUnit(我还安装了 Selenium RC 用于 PHP 测试)。现在我想卸载它(同时删除所有相关的文件夹和文件)
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?
我检查了 PHPUnit 文件夹,它还在吗?
Was it uninstalled? I try to reinstall a new PHPUnit, but the console displayed:
是卸载了吗?我尝试重新安装一个新的 PHPUnit,但控制台显示:
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
:
采纳答案by hakre
I checked the PHPUnit folder, it was still there?
我检查了 PHPUnit 文件夹,它还在吗?
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:
这将需要一些时间,并将更新当前安装的所有内容。由于您已经有一些扩展可用,并且最新版本的 PHPUnit 可能需要这些扩展,因此请更新它们以防止在下一个命令中失败:
> 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
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:
然后强制安装phpunit:
> pear install -a -f phpunit/PHPUnit