2
votes

We have decided to commit the vendor directory inside our git repo for deployment practicality. Things are working however everytime we run composer dump-autoload it modifies the following files which is quite annoying as it doesn't seem to represent a specific state of files it looks like a random number every time you re-run it. How should I handle this?

vendor/autoload.php

return ComposerAutoloaderInit54ff9d13a4342a89ea5000269df2222::getLoader();

vendor/composer/autoload_real.php

spl_autoload_register(array('ComposerAutoloaderInit54ff9d13a4342a89ea5000269df2222', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit54ff9d13a4342a89ea5000269df2222', 'loadClassLoader'));

Git detects these as changed but I can't see any changes at all, it even says 0 lines added, 0 lines removed

vendor/composer/ClassLoader.php

vendor/composer/autoload_classmap.php

vendor/composer/autoload_files.php

vendor/composer/autoload_namespace.php

vendor/composer/include_paths.php

1

1 Answers

1
votes

To my knowledge it is not advisable to use previous Composer Autoload files. I tried it once, since I was using Beanstalkapp + it's deployment feature but rather quickly I found out that it wasn't such a brilliant idea since nothing was loaded and I was getting some major errors.

Maybe it's an idea to not include the vendor folder at all and only do those composer updates on the deployment server itself.

And as a quick tip, you generally don't want to update your Composer packages on a live server. Some things might break and it'll cause you a headache to fix.