What is the exact set of files that I should manually delete in order to make sure that a subsequent invocation of composer dump-autoload
will behave EXACTLY as it would in a virgin freshly cloned composer project that was just composer install
ed, but never previously dump-autoload
ed?
I am trying to reproduce and debug a problem that occurs during composer dump-autoload
command executed as part of a docker image build.
I want to avoid the slowness of actually running a docker build dozens of times during the iterative process of finding the solution.
Deleting the entire vendor/
directory and redoing composer install
every time is also suboptimal.
It always runs from "scratch". But I guess that if you want to be extra sure, you can simply delete the previously generated files.
The created files are vendor/autoload.php
and some on vendor/composer
, so you could delete them manually before re-dumping the autoloader.
These are the contents of that directory fresh out of a composer install --no-autoloader
:
└── vendor/
└── composer/
├── semver/
├── xdebug-handler/
├── installed.json
└── LICENSE
And these are its contents after running composer dump-autoload
:
├── vendor/
│ └── composer/
│ ├── semver/
│ ├── xdebug-handler/
│ ├── autoload_classmap.php
│ ├── autoload_files.php
│ ├── autoload_namespaces.php
│ ├── autoload_psr4.php
│ ├── autoload_real.php
│ ├── autoload_static.php
│ ├── installed.json
│ └── LICENSE
└── autoload.php
So you basically need just to delete
vendor/autoload.php
vendor/composer/autoload_*
vendor/composer/ClassLoader.php
And you can rerun composer dump-autoload
from a pristine starting point.
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