Is there a way to block the version of PHPUnit?

I would like to be able to run the command:

pear update 

without updating PHPUnit, but everything else can be updated for free (if it does not violate the requirements for PHPUnit requirements).

So, is there a way to block one version of a package?

Thanks!

+4
source share
2 answers

You can try writing a simple shell script that will make the pear-delete channel for the phpunit channel, then update and then add the channel back.

+1
source

I also support a bunch of ZF1 applications, and I also have to deal with PHPUnit version 3.4.15 for our tests, but we took a different approach: we removed PHPUnit via a pear and downloaded the source code from PHPUnit git repo, then we create a phar package that will we then symbolize in the / usr / bin directory as an executable file.

I have phpunit-3.4.15 working side by side with PHPUnit installed by PEAR, but if you do not need a higher version, you can completely remove the PEAR package.

 $ sudo pear uninstall phpunit/PHPUnit 

If you use phing, you need to force ping to ignore PHPUnit dependencies.

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

 $ 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 are tricking the system a bit, we need to add some things to our php.ini configuration.

  • in php.ini: phar.readonly = Off
  • in php.ini: include_path = ".: / path / to / pear: /tmp/phpunit-3.4.15"
0
source

Source: https://habr.com/ru/post/1396671/


All Articles