Skip to content
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

Allow to provide drupal_root via an environment variable. #702

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

AlexSkrypnyk
Copy link

This helps in cases when PHPStan is called outside of the main website location.

@AlexSkrypnyk
Copy link
Author

Integration tests are currently failing on main, so not related to this change.

Comment on lines -88 to 89
$drupalRoot = realpath($drupalParams['drupal_root']);
$drupalRoot = realpath(getenv('DRUPAL_ROOT') !== false ? getenv('DRUPAL_ROOT') : $drupalParams['drupal_root']);
$finder = new DrupalFinder();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this would add a new environment variable called DRUPAL_ROOT that can be defined? I wonder, since bootstrap.inc is included via Composer's autoloading if we should use the DRUPAL_ROOT constant.

But I don't know if I want to rely on that global constant. It's preferred to use app.root container parameter (which we cannot use.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants