-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Classes from root package not available during ScriptEvents::PRE_AUTOLOAD_DUMP plugin event #9530
Comments
The goal I'm trying achieve is to generate classes and have those included in the (optimized) autoloader before the autoloader is dumped. And I know it kinda sounds funny because I'm expecting the autoloader to be available before it is dumped, but assuming this is not the first run everything runs smoothly, except for any classes in the root package not being available. If this isn't reasonable to expect from composer that's fine by me, I'm trying to create the best DX for uses of packages using this construction. |
… is also autoloaded correctly, refs #9530
94076c0 fixes it for the cases where the plugin requires the root package, as plugin dependencies are autoloaded. This was an edge case which we did not cover correctly. If you need autoloading of the root package even tho the plugin does not require it, please explain why. |
Awesome work 👍 !
I'm getting annotations from the root package with the plugin and generating compiled code based on that. Possibly I can look at a different way of reading those annotations without the need for autoloading to do this. |
Hm ok, it doesn't sound completely unreasonable to me to make the root package classes always autoloadable during plugin execution. @naderman any objection to this? |
@Seldaek Seems fine to me! |
Much appreciated! |
My
composer.json
:Please see a reproducable set up at: https://github.com/WyriHaximus/composer-plugin-reproc
Output of
composer diagnose
:When I run this command:
I get the following output:
And I expected this to happen:
The text was updated successfully, but these errors were encountered: