X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=civicrm-version.php;h=2209ab9240620074ca6515873a4f6de829899a8b;hb=49f7295641be4fa61020ac195011b533bd57f949;hp=6292f2b2cdd8e5ec2beceea90dd776227a00299a;hpb=292931f6bd575101c6f6a9ee93700fcf263b88a9;p=civicrm-core.git diff --git a/civicrm-version.php b/civicrm-version.php old mode 100755 new mode 100644 index 6292f2b2cd..2209ab9240 --- a/civicrm-version.php +++ b/civicrm-version.php @@ -1,8 +1,8 @@ =') && version_compare(VERSION, '7.0', '<')) { return 'Drupal6'; } 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(); @@ -55,10 +64,12 @@ namespace Civi { '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', @@ -103,16 +114,19 @@ namespace Civi { } 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 [ - 'version' => \Civi\Version::findVersion(), - 'cms' => \Civi\Version::findCMS(), + 'version' => \_CiviVersion_\Util::findVersion(), + 'cms' => \_CiviVersion_\Util::findCMS(), ]; } + }