Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Runtime] Fix class validation of composer "extra.runtime.class"#43376
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Ahummeling commentedOct 12, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Perhaps this issue can be resolved without omitting the check entirely. Could it be the case that the |
piku235 commentedOct 13, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@Ahummelin I'd also like to keep it, but because of how things internally work for composer plugins it seems hard to get and therefore not worth it. The issue is more about the |
Ahummeling left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Yeah I see what you mean now, going over the doc foris_subclass_of, seems that the autoloader can be disabled, but then you'd need to get an instance of the class, which was what we're trying to get around in the first place...
With that said, I think the PR looks good
nicolas-grekas commentedOct 14, 2021
Thank you@piku235. |
This PR fixes a bug of validating a runtime class from the composer param
extra.runtime.class. When provided, it always fails. Taking as an example theRuntime\Swoole\Runtimeof theruntime/swoolepackage, when executing thecomposer dump-autoload, it ends with the following exception, even though theruntime/swoolepackage was installed.When a composer plugin is executed, the composer autoloader for the project is not registered, thereby any reference to a class from installed packages won't work.
The fix drops this check to avoid it. I don't think it's worth checking here if a runtime class is valid or not. For instance, anything that comes from the
$_SERVER['APP_RUNTIME']is accepted, nothing is validated.