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
Fixes #7560 manually look for DOMDocument #7563
Conversation
I was thinking a better solution might be to do |
Yes but if you look at the original issue we have to assume Psalm was installed and the extension WAS loaded as they stated that it worked fine from the other CLI entry point, just not language server entry point. I'm up to checking both but I still think DOMDocument has to be checked through class_exists as a fallback Note: I also forgot to run phpcs :( |
If the extension was loaded wouldn't the class have to exist though? I was under the impression that somehow the extension was loaded when running from CLI but not when running the language server from vscode. @PythooonUser do you have any idea why it worked when running from CLI if you didn't have the XML extension installed? |
This is probably the more elegant and reliant solution. Also means it would be easier to find the checks if they're at a consistent check location. |
@tm1000 Mystery solved, they were actually different environments. I think the |
Yup you are right So is the location I'm looking the best place to check the extension loaded or is there a better place to check for all extensions |
It looks like composer 2.0 already does this on startup through autoload.php unless I'm mistaken |
I would say as early as possible, maybe somewhere in
Oh, I wasn't aware that was done at runtime, I've only used that through the CLI interface. |
The issue with relying on composer (and yes there is a setting we can put into composer.json to check the extensions) is that it looks to be a 2.0 feature only |
I think we could require |
That was actually added about a month ago and then removed by @weirdan in a revert (see: weirdan@a4878ac) I don't think we can require that at this time. Best check might just to be to do it ourselves. |
That option goes into |
@weirdan good point. |
4.x branch is closed now as we prepare for the 5.0 release. Please target the master branch instead. |
Superseded by #8782 |
Manually look for DOMDocument. See #7560