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

Leo*_*orf 19 php windows selenium pear phpunit

我几天前使用PEAR安装程序安装了PHPUnit(我还安装了Selenium RC以便在PHP中进行测试).现在我要卸载它(也删除所有相关的文件夹和文件)

我运行了以下命令:

pear uninstall phpunit/PHPUnit
Run Code Online (Sandbox Code Playgroud)

和控制台显示:

phpunit/PHPUnit not installed
Run Code Online (Sandbox Code Playgroud)

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

它被卸载了吗?我尝试重新安装一个新的PHPUnit,但控制台显示:

No releases available for package "pear.phpunit.de/PHPUnit"
Run Code Online (Sandbox Code Playgroud)

我该如何重新安装?


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

梨列表-c pear.phpunit.de

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

梨列表-c pear.phpunit.de

hak*_*kre 12

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

这可能是因为子组件(扩展,框架).但是你不必担心.

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

> pear config-set auto_discover 1
config-set succeeded

> pear upgrade
...
Run Code Online (Sandbox Code Playgroud)

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

> pear install pear.phpunit.de/PHPUnit
Run Code Online (Sandbox Code Playgroud)

现在应该安装它:

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
Run Code Online (Sandbox Code Playgroud)

PEAR故障排除

正如您在评论中所述,这没有成功.梨可能处于不知道顶部和底部在哪里的状态.时间到了.首先,清除缓存:

> pear clear-cache
reading directory C:\...\Temp\pear\cache
0 cache entries cleared
Run Code Online (Sandbox Code Playgroud)

然后强制频道更新:

> 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
Run Code Online (Sandbox Code Playgroud)

然后强制phpunit安装:

> pear install -a -f phpunit/PHPUnit
Run Code Online (Sandbox Code Playgroud)


Ala*_*blo 6

由于Google将此问题称为"如何删除它",因此回答这个问题似乎很重要.

以root身份使用:

pear list -c phpunit | grep stable | awk '{print "phpunit/"$1}' | xargs pear uninstall
Run Code Online (Sandbox Code Playgroud)

在这里找到这个答案