From 717716132a53613d52f9c12b3f6f2c9303e6a8f3 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 10 May 2018 19:43:49 -0700 Subject: [PATCH] civicrm-version.php - Fix CMS detection in pre-booted Drupal8 Ex 1: Running `drush` commands Ex 2: Running `cv` with `--level=cms-only` --- civicrm-version.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/civicrm-version.php b/civicrm-version.php index dca00fe227..f5b46e76f9 100755 --- a/civicrm-version.php +++ b/civicrm-version.php @@ -38,6 +38,9 @@ namespace _CiviVersion_ { elseif (defined('ABSPATH') && function_exists('get_bloginfo')) { return 'WordPress'; } + elseif (defined('DRUPAL_ROOT') && class_exists('Drupal') && version_compare(\Drupal::VERSION, '8.0', '>=') && version_compare(\Drupal::VERSION, '9.0', '<')) { + return 'Drupal8'; + } else { // guess CMS name from the current path list($cmsType,) = self::findCMSRootPath(); -- 2.25.1