如何通过PEAR安装旧版本的PHPUnit?

时间:2022-10-11 07:14:40

I would like to downgrade my installation of PHPUnit 3.4 to 3.3. I'm just not sure how to do it.

我想将我的PHPUnit 3.4安装降级到3.3。我只是不确定该怎么做。

How do I install version 3.3 of PHPUnit on Ubuntu using PEAR?

如何使用PEAR在Ubuntu上安装PHPUnit 3.3版本?

5 个解决方案

#1


51  

You need to know the exact version number you wish to downgrade to. At the time of writing, the last release you're after is 3.3.17, which can be found out by checking the appropriate PEAR channel.

您需要知道要降级到的确切版本号。在撰写本文时,您所关注的最后一个版本是3.3.17,可以通过检查相应的PEAR通道找到它。

To downgrade to that particular version execute two commands:

要降级到该特定版本,请执行以下两个命令:

  • pear uninstall phpunit/PHPUnit
  • pear卸载phpunit / PHPUnit
  • pear install phpunit/PHPUnit-3.3.17
  • pear安装phpunit / PHPUnit-3.3.17

#2


22  

Note that if you wish to downgrade from a 3.6.x release to 3.5.15 (final stable 3.x release), then you need to uninstall, then reinstall several dependencies manually. Otherwise pear will just force install the latest version of PHPUnit.

请注意,如果您希望从3.6.x版本降级到3.5.15(最终稳定3.x版本),则需要卸载,然后手动重新安装多个依赖项。否则pear会强制安装最新版本的PHPUnit。

Here's how:

(Original instructions from Dusty Reagan's blog: http://dustyreagan.com/downgrade-phpunit-3-6-to-3-5-15/. duplicated to SO in case original link dies for some reason.)

(来自Dusty Reagan博客的原始说明:http://dustyreagan.com/downgrade-phpunit-3-6-to-3-5-15/。如果原始链接由于某种原因死亡,则复制到SO。)

First you need to uninstall PHPUnit 3.6 and all of it’s dependencies.

sudo pear uninstall phpunit/PHPUnit
sudo pear uninstall phpunit/DbUnit
sudo pear uninstall phpunit/PHP_CodeCoverage
sudo pear uninstall phpunit/File_Iterator
sudo pear uninstall phpunit/PHPUnit_MockObject
sudo pear uninstall phpunit/Text_Template
sudo pear uninstall phpunit/PHP_Timer
sudo pear uninstall phpunit/PHPUnit_Selenium
sudo pear uninstall pear.symfony-project.com/YAML

Next install these specific versions of each dependency, in this order, installing PHPUnit-3.5.15 last.

sudo pear install pear.symfony-project.com/YAML-1.0.2
sudo pear install phpunit/PHPUnit_Selenium-1.0.1
sudo pear install phpunit/Text_Template-1.0.0
sudo pear install phpunit/PHPUnit_MockObject-1.0.3
sudo pear install phpunit/PHP_Timer-1.0.0
sudo pear install phpunit/File_Iterator-1.2.3
sudo pear install phpunit/PHP_CodeCoverage-1.0.2
sudo pear install phpunit/DbUnit-1.0.0
sudo pear install phpunit/PHPUnit-3.5.15

Note: You may need to add channel for PHP_CodeCoverage, which doesn't seem to be obligatory for PHPUnit 3.6

注意:您可能需要为PHP_CodeCoverage添加通道,这对于PHPUnit 3.6来说似乎不是必须的

sudo pear channel-discover components.ez.no
sudo pear install channel://components.ez.no/ConsoleTools-1.6

#3


6  

If you get the error Fatal error: Class 'PHP_Token_Stream' not found in /usr/share/pear/PHP/Token/Stream/CachingFactory.php on line 68 you will need to use the following order, so that you get the correct version of PHP_TokenStream:

如果您收到错误致命错误:在第68行的/usr/share/pear/PHP/Token/Stream/CachingFactory.php中找不到类'PHP_Token_Stream',您将需要使用以下顺序,以便获得正确的版本PHP_TokenStream:

pear uninstall phpunit/PHPUnit
pear uninstall phpunit/DbUnit
pear uninstall phpunit/PHP_CodeCoverage
pear uninstall phpunit/PHP_TokenStream
pear uninstall phpunit/File_Iterator
pear uninstall phpunit/PHP_Timer
pear uninstall phpunit/PHPUnit_MockObject
pear uninstall phpunit/Text_Template
pear uninstall phpunit/PHPUnit_Selenium
pear uninstall pear.symfony-project.com/YAML


pear install pear.symfony-project.com/YAML-1.0.2
pear install phpunit/PHPUnit_Selenium-1.0.1
pear install phpunit/Text_Template-1.0.0
pear install phpunit/PHPUnit_MockObject-1.0.3
pear install phpunit/PHP_Timer-1.0.0
pear install phpunit/File_Iterator-1.2.3
pear install phpunit/PHP_TokenStream-1.0.1
pear install phpunit/PHP_CodeCoverage-1.0.2
pear install phpunit/DbUnit-1.0.0
pear install phpunit/PHPUnit-3.5.15

#4


1  

I don't know if it's always possible using PEAR alone.

我不知道是否总是可以单独使用PEAR。

When I had to downgrade a package before, the old version was no longer available in the channel. I uninstalled the package I wanted to downgrade, downloaded the old version, and installed from the downloaded file.

当我不得不降级包之前,旧版本在频道中不再可用。我卸载了我想要降级的软件包,下载旧版本,并从下载的文件中安装。

#5


0  

As to downgrading from 3.6.x to 3.5.15, it works fine for me in the following order:

至于从3.6.x降级到3.5.15,它按以下顺序对我工作正常:

Uninstallation of 3.6

卸载3.6

sudo pear uninstall phpunit/PHPUnit_Selenium
sudo pear uninstall phpunit/PHPUnit
sudo pear uninstall phpunit/DbUnit
sudo pear uninstall phpunit/PHP_CodeCoverage
sudo pear uninstall phpunit/PHP_Iterator
sudo pear uninstall phpunit/PHPUnit_MockObject
sudo pear uninstall phpunit/Text_Template
sudo pear uninstall phpunit/PHP_Timer
sudo pear uninstall phpunit/File_Iterator
sudo pear uninstall pear.symfony-project.com/YAML

Installation of 3.5.15

安装3.5.15

sudo pear install pear.symfony-project.com/YAML-1.0.2
sudo pear install phpunit/PHPUnit_Selenium-1.0.1
sudo pear install phpunit/PHP_Timer-1.0.0
sudo pear install phpunit/Text_Template-1.0.0
sudo pear install phpunit/PHPUnit_MockObject-1.0.3
sudo pear install phpunit/File_Iterator-1.2.3
sudo pear install phpunit/PHP_CodeCoverage-1.0.2
sudo pear install phpunit/DbUnit-1.0.0
sudo pear install phpunit/PHPUnit-3.5.15

I have found the solution HERE.

我在这里找到了解决方案。

#1


51  

You need to know the exact version number you wish to downgrade to. At the time of writing, the last release you're after is 3.3.17, which can be found out by checking the appropriate PEAR channel.

您需要知道要降级到的确切版本号。在撰写本文时,您所关注的最后一个版本是3.3.17,可以通过检查相应的PEAR通道找到它。

To downgrade to that particular version execute two commands:

要降级到该特定版本,请执行以下两个命令:

  • pear uninstall phpunit/PHPUnit
  • pear卸载phpunit / PHPUnit
  • pear install phpunit/PHPUnit-3.3.17
  • pear安装phpunit / PHPUnit-3.3.17

#2


22  

Note that if you wish to downgrade from a 3.6.x release to 3.5.15 (final stable 3.x release), then you need to uninstall, then reinstall several dependencies manually. Otherwise pear will just force install the latest version of PHPUnit.

请注意,如果您希望从3.6.x版本降级到3.5.15(最终稳定3.x版本),则需要卸载,然后手动重新安装多个依赖项。否则pear会强制安装最新版本的PHPUnit。

Here's how:

(Original instructions from Dusty Reagan's blog: http://dustyreagan.com/downgrade-phpunit-3-6-to-3-5-15/. duplicated to SO in case original link dies for some reason.)

(来自Dusty Reagan博客的原始说明:http://dustyreagan.com/downgrade-phpunit-3-6-to-3-5-15/。如果原始链接由于某种原因死亡,则复制到SO。)

First you need to uninstall PHPUnit 3.6 and all of it’s dependencies.

sudo pear uninstall phpunit/PHPUnit
sudo pear uninstall phpunit/DbUnit
sudo pear uninstall phpunit/PHP_CodeCoverage
sudo pear uninstall phpunit/File_Iterator
sudo pear uninstall phpunit/PHPUnit_MockObject
sudo pear uninstall phpunit/Text_Template
sudo pear uninstall phpunit/PHP_Timer
sudo pear uninstall phpunit/PHPUnit_Selenium
sudo pear uninstall pear.symfony-project.com/YAML

Next install these specific versions of each dependency, in this order, installing PHPUnit-3.5.15 last.

sudo pear install pear.symfony-project.com/YAML-1.0.2
sudo pear install phpunit/PHPUnit_Selenium-1.0.1
sudo pear install phpunit/Text_Template-1.0.0
sudo pear install phpunit/PHPUnit_MockObject-1.0.3
sudo pear install phpunit/PHP_Timer-1.0.0
sudo pear install phpunit/File_Iterator-1.2.3
sudo pear install phpunit/PHP_CodeCoverage-1.0.2
sudo pear install phpunit/DbUnit-1.0.0
sudo pear install phpunit/PHPUnit-3.5.15

Note: You may need to add channel for PHP_CodeCoverage, which doesn't seem to be obligatory for PHPUnit 3.6

注意:您可能需要为PHP_CodeCoverage添加通道,这对于PHPUnit 3.6来说似乎不是必须的

sudo pear channel-discover components.ez.no
sudo pear install channel://components.ez.no/ConsoleTools-1.6

#3


6  

If you get the error Fatal error: Class 'PHP_Token_Stream' not found in /usr/share/pear/PHP/Token/Stream/CachingFactory.php on line 68 you will need to use the following order, so that you get the correct version of PHP_TokenStream:

如果您收到错误致命错误:在第68行的/usr/share/pear/PHP/Token/Stream/CachingFactory.php中找不到类'PHP_Token_Stream',您将需要使用以下顺序,以便获得正确的版本PHP_TokenStream:

pear uninstall phpunit/PHPUnit
pear uninstall phpunit/DbUnit
pear uninstall phpunit/PHP_CodeCoverage
pear uninstall phpunit/PHP_TokenStream
pear uninstall phpunit/File_Iterator
pear uninstall phpunit/PHP_Timer
pear uninstall phpunit/PHPUnit_MockObject
pear uninstall phpunit/Text_Template
pear uninstall phpunit/PHPUnit_Selenium
pear uninstall pear.symfony-project.com/YAML


pear install pear.symfony-project.com/YAML-1.0.2
pear install phpunit/PHPUnit_Selenium-1.0.1
pear install phpunit/Text_Template-1.0.0
pear install phpunit/PHPUnit_MockObject-1.0.3
pear install phpunit/PHP_Timer-1.0.0
pear install phpunit/File_Iterator-1.2.3
pear install phpunit/PHP_TokenStream-1.0.1
pear install phpunit/PHP_CodeCoverage-1.0.2
pear install phpunit/DbUnit-1.0.0
pear install phpunit/PHPUnit-3.5.15

#4


1  

I don't know if it's always possible using PEAR alone.

我不知道是否总是可以单独使用PEAR。

When I had to downgrade a package before, the old version was no longer available in the channel. I uninstalled the package I wanted to downgrade, downloaded the old version, and installed from the downloaded file.

当我不得不降级包之前,旧版本在频道中不再可用。我卸载了我想要降级的软件包,下载旧版本,并从下载的文件中安装。

#5


0  

As to downgrading from 3.6.x to 3.5.15, it works fine for me in the following order:

至于从3.6.x降级到3.5.15,它按以下顺序对我工作正常:

Uninstallation of 3.6

卸载3.6

sudo pear uninstall phpunit/PHPUnit_Selenium
sudo pear uninstall phpunit/PHPUnit
sudo pear uninstall phpunit/DbUnit
sudo pear uninstall phpunit/PHP_CodeCoverage
sudo pear uninstall phpunit/PHP_Iterator
sudo pear uninstall phpunit/PHPUnit_MockObject
sudo pear uninstall phpunit/Text_Template
sudo pear uninstall phpunit/PHP_Timer
sudo pear uninstall phpunit/File_Iterator
sudo pear uninstall pear.symfony-project.com/YAML

Installation of 3.5.15

安装3.5.15

sudo pear install pear.symfony-project.com/YAML-1.0.2
sudo pear install phpunit/PHPUnit_Selenium-1.0.1
sudo pear install phpunit/PHP_Timer-1.0.0
sudo pear install phpunit/Text_Template-1.0.0
sudo pear install phpunit/PHPUnit_MockObject-1.0.3
sudo pear install phpunit/File_Iterator-1.2.3
sudo pear install phpunit/PHP_CodeCoverage-1.0.2
sudo pear install phpunit/DbUnit-1.0.0
sudo pear install phpunit/PHPUnit-3.5.15

I have found the solution HERE.

我在这里找到了解决方案。