Allow environment detector subclasses to override the isLocalEnv() #4336
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
We wan't to treat the Acquia IDE as a "local" environment. For that purpose we'd like to override the isLocalEnv() function but without this we can't as BLT won't check for subclasses when checking if it's a local environment.
Proposed changes
This PR adds the same check as other overridable functions to check for subclasses of the EnvironmentDetector and return their results.
Testing steps
To replicate the issue, instantiate an Acquia IDE and run blt setup. The setup will ask you for Drupal database settings and look for private file paths that are all usually defined in local.settings.php. Because it can't find these it will fail. An alternative would be to create a settings.local.php and edit the settings.php file to get around this but then the local config split won't import unless you add a symlink for an IDE split and configure one.
IMO these are too many hoops a developer needs to jump through to make the IDE run and behave like a local environment would. With this PR in place we can use https://github.com/pavlosdan/blt-ide-local to have BLT recognize the IDE as a local environment.