From 8a0e49bc860b530a30fbe5407dc6d1d4cd3a7263 Mon Sep 17 00:00:00 2001 From: Mikey O'Toole Date: Tue, 16 Jun 2020 11:02:48 +0100 Subject: [PATCH] [dev/core#750] Don't check server variables if we're running in CLI 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. Fix whitespace errors. Remove variable comment. Fix more whitespace! --- Civi/Install/Requirements.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Civi/Install/Requirements.php b/Civi/Install/Requirements.php index 586a0c75d2..d5f3d648eb 100644 --- a/Civi/Install/Requirements.php +++ b/Civi/Install/Requirements.php @@ -28,12 +28,15 @@ class Requirements { */ protected $system_checks = [ 'checkMemory', - 'checkServerVariables', 'checkMysqlConnectExists', 'checkJsonEncodeExists', 'checkMultibyteExists', ]; + protected $system_checks_web = [ + 'checkServerVariables', + ]; + protected $database_checks = [ 'checkMysqlConnection', 'checkMysqlVersion', @@ -83,6 +86,12 @@ class Requirements { $errors[] = $this->$check(); } + if (PHP_SAPI !== 'cli') { + foreach ($this->system_checks_web as $check) { + $errors[] = $this->$check(); + } + } + return $errors; } -- 2.25.1