Closed mlocati closed 8 years ago
I did the following test with the current plugin version:
Create this composer.json
file:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/mlocati/class-loader"
},
{
"type": "vcs",
"url": "https://github.com/mlocati/log"
}
],
"require": {
"symfony/class-loader": "99.*",
"psr/log": "1.*"
},
"config": {
"optimize-autoloader": true,
"preferred-install": {
"*": "dist"
},
"octolab/cleaner": {
"clear": {
"*": "*"
}
}
}
}
Running composer install
, vendor/composer/autoload_classmap.php
contains references to the test classes of psr/log
(as expected, since we're installing the official psr/log package).
Running composer require psr/log:99.*
uses my forked version of psr/log (that specifies the files to be removed), and the references to the test classes are removed from composer autoload files... Great!
:+1:
This is not mandatory, but it would be nice if this tool could remove references to the deleted files/directories from the composer autoload files:
vendor/composer/autoload_classmap.php
vendor/composer/autoload_files.php
vendor/composer/autoload_namespaces.php
vendor/composer/autoload_psr4.php
vendor/composer/autoload_static.php
For instance, if we delete the
tests
directory from packagevendor1/package1
, we should strip out the following line fromvendor/composer/autoload_classmap.php
: