Is there a way to update just one bundle without updating every bundle in your deps file? I am currently using "php vendors install" to install all vendor bundles and am not aware of any commands that will update just one bundle at a time.
问题:
回答1:
1) Just open your deps file (./deps)
2) Remove all bundles except the one you want to update and save the deps file
3) Let's run the command: php bin/vendors update
It will update the bundle.
4) Go back in your deps file and rewrite all the previous removed bundle lines !
Cheers !
回答2:
Short version: The "best way" to do this depends on your setup. If you've run "php bin/vendors update" before, then it would probably be best to remove the line for the bundle you want to update from your deps.lock file, then run "php bin/vendors install" from your base symfony folder.
Long version: I think some clarification of what the various vendor commands do is in order.
1) php bin/vendors install
This command downloads (if necessary) and installs vendor bundle source files into symfony/vendor. This command will first look at deps.lock to see what git commits/versions are listed there, then it will look at your deps file to see what versions are listed there. If no version is specified in either for a certain bundle, it will download the most recent version of the bundle code for that bundle. If a version is found, it will download and install that version of the vendor bundle code.
This command will not put anything in deps.lock.
2) php bin/vendors install --reinstall
This command does the same thing as php bin/vendors install, except it will always download the code before installing it into symfony/vendor.
This command will not put anything in deps.lock.
3) php bin/vendors update
This command will ignore deps.lock, and will download (if necessary) and install the versions of bundle code listed in the deps file into symfony/vendor.
After it is done downloading and installing code, it will put the git commit id / version of the downloaded code for each bundle into your deps.lock file. That way, when you go to run one of the install commands listed above, the version of code that is downloaded won't change unless you remove the related line from the deps.lock file or if your run the update command again.
The idea behind the deps.lock file is that it prevents you from accidentally upgrading your bundles to a more recent bug non-working version of the 3rd party bundle code. Symfony and it's bundles are under constant development, so changes (even if they're not bugs) happen pretty frequently and will break your code. You'll probably want to get your versions locked down in deps.lock as soon as possible and only update when you feel like going out of your way to do so.
Once you've locked down your bundle versions in deps.lock, you'll just need to remove the related line from your deps.lock file the run one of the install commands to update a specific bundle, like I said in the short answer above. If you then want to lock that code down to the version you just installed, you'll want to add a line to deps.lock yourself, or remove everything from deps and run php bin/vendor update like the answer above indicates.