From: Mikey O'Toole Date: Tue, 16 Jun 2020 10:02:48 +0000 (+0100) Subject: [dev/core#750] Don't check server variables if we're running in CLI X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8a0e49bc860b530a30fbe5407dc6d1d4cd3a7263;p=civicrm-core.git [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! --- 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; }