Merge pull request #12209 from JMAConsulting/access-3-event
[civicrm-core.git] / CRM / Utils / System.php
index 394dde66392b3f2ca956fb60eb1f092e8abe017d..e2d72f5303244d9eb8c031c82696994bedd3f47f 100644 (file)
@@ -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)) {