[dev/core#750] Don't check server variables if we're running in CLI #17636
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.
Overview
This PR introduces skipping the server variable checks if we're running in a CLI environment, removing an error when running Drush commands against Drupal 8 and Drupal 9 based sites.
Before
What is the old user-interface or technical-contract (as appropriate)?
Drush commands error due to missing server variables, however we shouldn't actually check these variables when running from CLI environments as it's not reasonable to expect them to be set.
After
What changed? What is new old user-interface or technical-contract?
The server variables check is now only run for non-cli environments. The error no longer appears!