I'm updating symfony verdors via composer. I always do it using:
php composer.phar update
But recent version of composer, before update each package show a message like this:
- Updating doctrine/data-fixtures dev-master (a95d783 => a28b6bd) The package has modified files: M .gitignore M .gitmodules M LICENSE M README.md M UPGRADE M composer.json M lib/Doctrine/Common/DataFixtures/AbstractFixture.php M lib/Doctrine/Common/DataFixtures/DependentFixtureInterface.php M lib/Doctrine/Common/DataFixtures/Event/Listener/MongoDBReferenceListener.php M lib/Doctrine/Common/DataFixtures/Event/Listener/ORMReferenceListener.php
-10 more files modified, choose "v" to view the full list Discard changes [y,n,v,s,?]?
How to avoid this?
Try clearing Composer's cache by running composer clear-cache . Ensure you're installing vendors straight from your composer. json via rm -rf vendor && composer update -v when troubleshooting, excluding any possible interferences with existing vendor installations or composer. lock entries.
It is a PHAR (PHP archive), which is an archive format for PHP which can be run on the command line, amongst other things. we can think of it as the program's executable. you wouldn't be able to run composer without it. You can place the Composer PHAR anywhere you wish.
You should never use composer update without argument. composer update reads every package listed on composer. json, and updates it to the latest available version compatible with the specified version constraints. In a perfect world, all librairies would follow semver correctly, and it shouldn't have any side effects.
update / u# In order to get the latest versions of the dependencies and to update the composer. lock file, you should use the update command. This command is also aliased as upgrade as it does the same as upgrade does if you are thinking of apt-get or similar package managers.
Set composer config to discard changes (see: https://github.com/composer/composer/pull/1188):
php composer.phar config --global discard-changes true
both @lemats and @reza-sanaie's answers are incomplete as --no-interaction (-n) composer's option is required to have a real update without any question (see https://github.com/composer/composer/pull/1188#issuecomment-16011533).
So after
php composer.phar config --global discard-changes true
or after modifying composer.json
"config": { "discard-changes": true },
use
php composer.phar update -n
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With