1

I am curious if there is a way to have composer regenerate a new composer.lock without it actually going though the upgrade/install process? I just want to change the version in the lockfile for git without actually installing a local copy of the dependencies.

steve3747
  • 13
  • 3
  • You can run `composer update --lock` to only update the git hashes, so the lock file does not complain about being outdated. Is this what you are looking for? – dbrumann Mar 08 '20 at 09:20
  • I don't think `composer` will be able to do this because it will need the packages installed in order to generate the `content-hash` values. – Calum Halpin Mar 08 '20 at 12:47
  • There is an open [issue](https://github.com/composer/composer/issues/8551) on the Composer repository on Github to introduce this feature. – D Malan Mar 09 '20 at 15:13
  • @Delena Malan Thanks. I will keep watching that to see if things chage. It's not the end of the world we can still do what we want it will just take longer as we will have to wait for the whole project to be setup by composer. We are going to be making a script so each time a dependency has a new version the script will update composer.json and composer.lock commit to a new branch, deploy to a test enviroment, and open a pull request to master. So we can just test and accept the pull request. – steve3747 Mar 10 '20 at 11:54
  • Does this answer your question? [Can composer generate the \`composer.lock\` without actually download the packages?](https://stackoverflow.com/questions/44805083/can-composer-generate-the-composer-lock-without-actually-download-the-packages) – leymannx Jan 11 '23 at 19:25

0 Answers0