-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Drupal Check could not find Drupal root but PHPstan could #97
Comments
I may have a fix for this problem, I just need to verify whether it works with the global installation as well. |
mxr576
added a commit
to mxr576/drupal-check
that referenced
this issue
Jul 25, 2019
As it can not find it in given circumstances. mglaman#97
mxr576
added a commit
to mxr576/drupal-check
that referenced
this issue
Jul 25, 2019
As it can not find it in given circumstances. mglaman#97
mxr576
added a commit
to mxr576/drupal-check
that referenced
this issue
Jul 25, 2019
Sometimes Drupal root cannot be located programmatically. mglaman#97
mxr576
added a commit
to mxr576/drupal-check
that referenced
this issue
Jul 25, 2019
Sometimes Drupal root cannot be located programmatically. mglaman#97
wiser-soft
added a commit
to wiser-soft/drupal-check
that referenced
this issue
Apr 12, 2023
Sometimes Drupal root cannot be located programmatically. mglaman/drupal-check#97
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How is drupal-check installed?
Environment:
Describe the bug
![image](https://user-images.githubusercontent.com/1755573/61853328-ef64f880-aebb-11e9-8d11-eff6a6028379.png)
![image](https://user-images.githubusercontent.com/1755573/61853364-0ad00380-aebc-11e9-9315-dfff12b49735.png)
![image](https://user-images.githubusercontent.com/1755573/61853218-a57c1280-aebb-11e9-939f-7882fc23ee47.png)
I am working with a monorepo that structure is the following:
Drupal Check tries to do something smart to figure out the Drupal root and the location of the vendor dir but Drupal Finder unable to locate Drupal root in the given structure if I run
./vendor/bin/drupal-check web/modules/contrib/[SYMLINKED_MODULE]
.Although, if I call PHPstan directly with the following parameters it works perfectly fine:
./vendor/bin/phpstan analyze -c vendor/mglaman/drupal-check/phpstan/rules_and_deprecations_testing.neon web/modules/contrib/[SYMLINKED_MODULE]
.As I can see the reason behind this is that Drupal Check calls Drupal Finder first to figure out the Drupal root to mimic PHPStan's
$GLOBALS['autoloaderInWorkingDirectory']
trick. Although, as I described above Drupal Finder is unable to find Drupal root in the given setup this is the reason why Drupal Check fails but PHPstan does not.Console output
N/A
The text was updated successfully, but these errors were encountered: