Merge pull request #19708 from J0WI/patch-1
[civicrm-core.git] / civicrm-version.php
old mode 100755 (executable)
new mode 100644 (file)
index 764bf55..2209ab9
@@ -35,6 +35,12 @@ namespace _CiviVersion_ {
       elseif (function_exists('drupal_bootstrap') && version_compare(VERSION, '7.0', '>=') && version_compare(VERSION, '8.0', '<')) {
         return 'Drupal';
       }
+      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();
@@ -58,10 +64,12 @@ namespace _CiviVersion_ {
           'administrator/components/com_civicrm/civicrm/civicrm-version.php',
         ),
         'Drupal' => array(
-          'modules/system/system.module', // D7
+          // D7
+          'modules/system/system.module',
         ),
         'Drupal8' => array(
-          'core/core.services.yml', // D8
+          // D8
+          'core/core.services.yml',
         ),
         'Backdrop' => array(
           'core/modules/layout/layout.module',
@@ -106,11 +114,13 @@ namespace _CiviVersion_ {
 }
 
 namespace {
+
   /**
    * Get the CiviCRM version.
    * TODO : For now this function is not included in \Civi\Version class so not to break any code
    *   which directly call civicrmVersion(). So those call need to replaced with \Civi\Version::civicrmVersion()
    *   when included in the class
+   * @deprecated
    */
   function civicrmVersion() {
     return [
@@ -118,4 +128,5 @@ namespace {
       'cms' => \_CiviVersion_\Util::findCMS(),
     ];
   }
+
 }