Closed JUVOJustin closed 6 months ago
I thought it was nice to clean up empty folders after their contents are deleted with delete_vendor_files
/delete_vendor_packages
: https://github.com/BrianHenryIE/strauss/blob/f03e9176f463cf2c3f2fca5b2796c03c8e9e5729/src/Cleanup.php#L118
but then when composer update
is run, or more specifically composer dump-autoload
, it uses the original composer.json
's autoload
keys to determine which directories to scan for classes, and those directories no longer exist.
The autoload
keys are stored in vendor/composer/installed.json
and composer.lock
but only vendor/composer/installed.json
is important here.
I'll add some code so when directories are deleted, if they're present in installed.json
I'll remove them from there too (or maybe update, I'll have to think about that). This is closely related to #87
Minimal reproduction:
{
"name": "strauss/issue93",
"require": {
"symfony/polyfill-php80": "v1.29.0"
},
"extra": {
"strauss": {
"namespace_prefix": "Strauss\\Issue93\\",
"delete_vendor_files": true
}
}
}
curl -o strauss.phar -L -C - https://github.com/BrianHenryIE/strauss/releases/download/0.17.0/strauss.phar;
chmod +x strauss.phar;
composer update;
./strauss.phar;
composer dump-autoload;
Generating autoload files
In ClassMapGenerator.php line 129:
Could not scan for classes inside "/path/to/vendor/symfony/polyfill-php80/Resources/stubs" which does not appear to be a file nor a folder
I'm working on a significant rewrite at the moment which will help close a few issues. Realistically it will be a while before I get to this.
https://github.com/brianhenryie/strauss/compare/master...use-files-objects-with-properties
Thank you very much for the in detail feedback. Really appreciate it! It is more or less easy to workaround, so i am happy with waiting for the rewrite. Thank you very mch
When using strauss with some dependencies, it generally works. Especially when using with an empty or not existing vendor folder. However when running
composer update
i get the following error:Could not scan for classes inside "/var/www/html/wp-content/plugins/juvo-mail-editor/vendor/symfony/polyfill-php80/Resources/stubs" which does not appear to be a file nor a folder
This can be "solved" by simply removing the vendor folder before running
composer update
. Is this some misconfiguration or an incompatibility?