civicrm-version.php - Fix CMS detection in pre-booted Drupal8
authorTim Otten <totten@civicrm.org>
Fri, 11 May 2018 02:43:49 +0000 (19:43 -0700)
committerTim Otten <totten@civicrm.org>
Fri, 11 May 2018 03:03:46 +0000 (20:03 -0700)
Ex 1: Running `drush` commands
Ex 2: Running `cv` with `--level=cms-only`

civicrm-version.php

index dca00fe227d4c67c8906314ddbd393312c4b706a..f5b46e76f9e7ed18b822cba08d97647083bc4c05 100755 (executable)
@@ -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();