有没有办法锁定PHPUnit版本?

时间:2021-11-22 07:18:09

I would like to be able to run the command:

我希望能够运行命令:

pear update

without upgrading PHPUnit, but everything else is free to get upgraded (as long as it doesn't break PHPUnit dependency requirements).

没有升级PHPUnit,但其他一切都可以*升级(只要它不破坏PHPUnit依赖性要求)。

So basically, is there a way to lock a single package's version?

基本上,有没有办法锁定单个软件包的版本?

Thanks!

2 个解决方案

#1


1  

You could try writing a simple shell script, which would do pear channel-delete for the phpunit channel, then update and then add the channel back.

您可以尝试编写一个简单的shell脚本,它将为phpunit通道执行pear channel-delete,然后更新然后再添加通道。

#2


0  

I'm also maintaining a bunch of ZF1 applications and I too have to deal with PHPUnit version 3.4.15 for our tests, but we took a different approach: we uninstalled PHPUnit through pear and downloaded the source code from PHPUnit's git repo, next we build the phar package which we then symlinked in /usr/bin directory as executable.

我也在维护一堆ZF1应用程序,我也必须处理PHPUnit版本3.4.15以进行测试,但我们采用了不同的方法:我们通过pear卸载了PHPUnit并从PHPUnit的git repo下载了源代码,接下来我们构建phar包,然后我们在/ usr / bin目录中作为可执行文件进行符号链接。

I'm having phpunit-3.4.15 running side-by-side to PHPUnit installed by PEAR, but if you don't need a higher version you can remove the PEAR package all together.

我正在将phpunit-3.4.15与PEAR安装的PHPUnit并排运行,但是如果你不需要更高版本,你可以一起删除PEAR包。

$ sudo pear uninstall phpunit/PHPUnit

If you use phing as well, you need to force installation of ping in disregards of dependencies to PHPUnit.

如果你也使用phing,你需要强制安装ping而忽略对PHPUnit的依赖。

The approach for the old PHPUnit as phar package is as follows:

旧的PHPUnit作为phar包的方法如下:

$ cd /tmp
$ curl -o phpunit-3.4.15.tar.gz https://codeload.github.com/sebastianbergmann/phpunit/tar.gz/3.4.15
$ tar -xvzf phpunit-3.4.15.tar.gz
$ cd phpunit-3.4.15/
$ /usr/bin/php make_phar.php
$ sudo ln -s /tmp/phpunit-3.4.15/phpunit.phar /usr/bin/phpunit34

PHP settings Since we're tricking the system a little, we need to add some things to our php.ini configuration.

PHP设置由于我们对系统进行了一些尝试,我们需要在php.ini配置中添加一些内容。

  • in php.ini: phar.readonly = Off
  • 在php.ini中:phar.readonly = Off

  • in php.ini: include_path = ".:/path/to/pear:/tmp/phpunit-3.4.15"
  • 在php.ini中:include_path =“。:/ path / to / pear:/tmp/phpunit-3.4.15”

#1


1  

You could try writing a simple shell script, which would do pear channel-delete for the phpunit channel, then update and then add the channel back.

您可以尝试编写一个简单的shell脚本,它将为phpunit通道执行pear channel-delete,然后更新然后再添加通道。

#2


0  

I'm also maintaining a bunch of ZF1 applications and I too have to deal with PHPUnit version 3.4.15 for our tests, but we took a different approach: we uninstalled PHPUnit through pear and downloaded the source code from PHPUnit's git repo, next we build the phar package which we then symlinked in /usr/bin directory as executable.

我也在维护一堆ZF1应用程序,我也必须处理PHPUnit版本3.4.15以进行测试,但我们采用了不同的方法:我们通过pear卸载了PHPUnit并从PHPUnit的git repo下载了源代码,接下来我们构建phar包,然后我们在/ usr / bin目录中作为可执行文件进行符号链接。

I'm having phpunit-3.4.15 running side-by-side to PHPUnit installed by PEAR, but if you don't need a higher version you can remove the PEAR package all together.

我正在将phpunit-3.4.15与PEAR安装的PHPUnit并排运行,但是如果你不需要更高版本,你可以一起删除PEAR包。

$ sudo pear uninstall phpunit/PHPUnit

If you use phing as well, you need to force installation of ping in disregards of dependencies to PHPUnit.

如果你也使用phing,你需要强制安装ping而忽略对PHPUnit的依赖。

The approach for the old PHPUnit as phar package is as follows:

旧的PHPUnit作为phar包的方法如下:

$ cd /tmp
$ curl -o phpunit-3.4.15.tar.gz https://codeload.github.com/sebastianbergmann/phpunit/tar.gz/3.4.15
$ tar -xvzf phpunit-3.4.15.tar.gz
$ cd phpunit-3.4.15/
$ /usr/bin/php make_phar.php
$ sudo ln -s /tmp/phpunit-3.4.15/phpunit.phar /usr/bin/phpunit34

PHP settings Since we're tricking the system a little, we need to add some things to our php.ini configuration.

PHP设置由于我们对系统进行了一些尝试,我们需要在php.ini配置中添加一些内容。

  • in php.ini: phar.readonly = Off
  • 在php.ini中:phar.readonly = Off

  • in php.ini: include_path = ".:/path/to/pear:/tmp/phpunit-3.4.15"
  • 在php.ini中:include_path =“。:/ path / to / pear:/tmp/phpunit-3.4.15”