Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do not update a specific package

Tags:

composer-php

Is there a way to tell composer that each time I do a composer update I want him to ignore a specific package?

like image 471
chris_so Avatar asked Jun 26 '13 07:06

chris_so


2 Answers

Have you considered specifying the required version for the package you are trying to ignore? For instance:

"require": {
    "some/package": "~1.2"
}

This may get updated, because you are saying any version >=1.2,<2.0, But if you strictly say you want only version 1.0, you should not see any updates to that package:

"require": {
    "some/package": "1.2"
}
like image 98
Matthew Brown Avatar answered Oct 15 '22 11:10

Matthew Brown


Actually I don't know if there is any way to tell composer to exclude one specific package from updating but you can tell which packages to update as

composer update <package> <package2>; // or
php composer.phar update <package> <package2>;

For example,

composer update foo/package1 bar/package2; // or
php composer.phar update foo/package1 bar/package2;

Also, I think, if you don't list them in composer.json (remove after installation) by yourself, then they will not be updated unless also specified in the list.

From Composer: If you only want to install or update one dependency, you can whitelist them:

$ php composer.phar update monolog/monolog [...]

Check this link and also check Composer.

Update : (found on internet but not tested)

To do that, just remove the package from composer.lock

like image 34
The Alpha Avatar answered Oct 15 '22 13:10

The Alpha