Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Updating Composer autoload files without `composer update`?

I'm working on a project which has a lot of dependencies which I personally control. Whenever the namespace mapping changes in a requirement, I need to run composer update to refresh the Composer autoload file so the namespace mappings can be picked up.

However if I'm making changes in the vendor/ directory directly, there's no need to check out the latest versions through composer update -- all I need is to refresh the autoload file. For a project with dozens of requirements hosted on GitHub, composer update can take minutes.

Is there any way to get composer to refresh the autoload files without having to run composer update?

like image 342
jevon Avatar asked Dec 15 '14 23:12

jevon


People also ask

How do I update my composer lock file?

lock file prevents you from automatically getting the latest versions of your dependencies. To update to the latest versions, use the update command. This will fetch the latest matching versions (according to your composer. json file) and update the lock file with the new versions.

How do I update the composer to the latest version?

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.

What is autoloading in composer?

Autoloading: The classmap Directive You just need to provide a list of directories, and Composer will scan all the files in those directories. For each file, Composer will make a list of classes that are contained in that file, and whenever one of those classes is needed, Composer will autoload the corresponding file.


1 Answers

composer install and/or composer dump-autoload would do the same. (dump-autoload documentation)

like image 68
Sven Avatar answered Sep 19 '22 19:09

Sven