Question

I am building a new app in Symfony 2.1. I am using a lot of bundles pulled in using composer. A lot of these bundles have problems with this latest version of Symfony and I am having to go into the /vendor folder to identify the issues.

This means that I am changing the vendor files directly - purely for testing purposes. (When we have fixed a bundle we branch and submit appropriate pull request).

What I want to know is if there is some command like composer.phar revert which would undo any changes made to the vendor folder (like a git checkout). At the moment if I run a composer update or installit does not do this.

Thanks

Était-ce utile?

La solution

composer install, if you have kept your composer.lock file, will revert all your vendors to the previously installed state.

Autres conseils

If you used composer update your composer.lock has changed to. So I make a little trick. Revert composer.lock by git and then run composer install. It'll remove newest packages and download the previous.

Add discard-changes to your composer.json file:

{
    "config": {
        "discard-changes": true
    }
}

Make sure you are using the latest version of Composer.

 cd /my/project/location/

 rm -rf vendor/my_vendor_to_rollBack

 composer install

As far as I can tell, none of the answers above work except in relation to versions. I you change an installed version, you can revert to a previous version.

If you just delete or change a file, though, the change will show up in composer status -v, but there's no way to revert (even with "discard-changes":true) except by removing and then re-requiring the package.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top