From 8a4e698fb7c465ef824934bc633e9dc932eafd46 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 10 May 2018 18:59:08 -0700 Subject: [PATCH] CRM/Utils/System.php - Don't go through civicrm-version.php In a typical environment, this is just an unnecessary file-load, and it makes it harder to (someday) remove/deprecate `civicrm-version.php`. --- CRM/Utils/System.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CRM/Utils/System.php b/CRM/Utils/System.php index 394dde6639..e2d72f5303 100644 --- a/CRM/Utils/System.php +++ b/CRM/Utils/System.php @@ -1081,9 +1081,14 @@ class CRM_Utils_System { static $version; if (!$version) { - $verFile = implode(DIRECTORY_SEPARATOR, [dirname(__FILE__), '..', '..', 'civicrm-version.php']); - require_once $verFile; - $version = \Civi\Version::findVersion(); + $verFile = implode(DIRECTORY_SEPARATOR, + array(dirname(__FILE__), '..', '..', 'xml', 'version.xml') + ); + if (file_exists($verFile)) { + $str = file_get_contents($verFile); + $xmlObj = simplexml_load_string($str); + $version = (string) $xmlObj->version_no; + } // pattern check if (!CRM_Utils_System::isVersionFormatValid($version)) { -- 2.25.1