From b551fc86fb74da8e1772561b5c5fe610eb50300b Mon Sep 17 00:00:00 2001 From: "deb.monish" Date: Tue, 20 Feb 2018 16:03:27 +0530 Subject: [PATCH 1/3] Remove templates/CRM/common/version.tpl --- .gitignore | 1 - CRM/Core/CodeGen/Version.php | 2 -- xml/templates/civicrm_version.tpl | 7 +------ 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index d732acbd1f4f..f7aa94f65993 100644 --- a/.gitignore +++ b/.gitignore @@ -21,7 +21,6 @@ sql/civicrm_data.mysql sql/civicrm_drop.mysql sql/civicrm_navigation.mysql sql/civicrm_sample.mysql -templates/CRM/common/version.tpl tests/phpunit/CiviTest/CiviSeleniumSettings.php tests/phpunit/CiviTest/civicrm.settings.php tools/stats/config.php diff --git a/CRM/Core/CodeGen/Version.php b/CRM/Core/CodeGen/Version.php index eb7272eddef3..e98e38e88814 100644 --- a/CRM/Core/CodeGen/Version.php +++ b/CRM/Core/CodeGen/Version.php @@ -7,8 +7,6 @@ class CRM_Core_CodeGen_Version extends CRM_Core_CodeGen_BaseTask { public function run() { echo "Generating civicrm-version file\n"; - file_put_contents($this->config->tplCodePath . "/CRM/common/version.tpl", $this->config->db_version); - $template = new CRM_Core_CodeGen_Util_Template('php'); $template->assign('db_version', $this->config->db_version); $template->assign('cms', ucwords($this->config->cms)); diff --git a/xml/templates/civicrm_version.tpl b/xml/templates/civicrm_version.tpl index 93a062ea7882..a91c1c26ec10 100644 --- a/xml/templates/civicrm_version.tpl +++ b/xml/templates/civicrm_version.tpl @@ -3,11 +3,6 @@ * Get the CiviCRM version. */ function civicrmVersion( ) {ldelim} -{include file="../../templates/CRM/common/version.tpl" assign=svnrevision} return array( 'version' => '{$db_version}', - 'cms' => '{$cms}', - 'revision' => '{$svnrevision}', ); + 'cms' => '{$cms}', ); {rdelim} - - - From 9e3fc39efc197e84f79d17c4909f1c215040bf1d Mon Sep 17 00:00:00 2001 From: "deb.monish" Date: Wed, 21 Feb 2018 08:44:25 +0530 Subject: [PATCH 2/3] add version.tpl in checklist --- CRM/Utils/Check/Component/Source.php | 1 + 1 file changed, 1 insertion(+) diff --git a/CRM/Utils/Check/Component/Source.php b/CRM/Utils/Check/Component/Source.php index 8371bc5861d1..dd649269f476 100644 --- a/CRM/Utils/Check/Component/Source.php +++ b/CRM/Utils/Check/Component/Source.php @@ -50,6 +50,7 @@ public function getRemovedFiles() { $files[] = '[civicrm.vendor]/pear/net_smtp/tests'; $files[] = '[civicrm.vendor]/pear/net_smtp/phpdoc.sh'; $files[] = '[civicrm.vendor]/phpoffice/phpword/samples'; + $files[] = '[civicrm.root]/templates/CRM/common/version.tpl'; return $files; } From e48985cac5f3a9201aa95b5747dd558d08460fce Mon Sep 17 00:00:00 2001 From: "deb.monish" Date: Wed, 21 Feb 2018 13:25:52 +0530 Subject: [PATCH 3/3] CRM-21787: Keep up-to-date without running GenCode on all builds --- CRM/Utils/System.php | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/CRM/Utils/System.php b/CRM/Utils/System.php index a253b091c047..5d2e762622ae 100644 --- a/CRM/Utils/System.php +++ b/CRM/Utils/System.php @@ -1074,25 +1074,12 @@ public static function version() { if (!$version) { $verFile = implode(DIRECTORY_SEPARATOR, - array(dirname(__FILE__), '..', '..', 'civicrm-version.php') + array(dirname(__FILE__), '..', '..', 'xml', 'version.xml') ); if (file_exists($verFile)) { - require_once $verFile; - if (function_exists('civicrmVersion')) { - $info = civicrmVersion(); - $version = $info['version']; - } - } - else { - // svn installs don't have version.txt by default. In that case version.xml should help - - $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; - } + $str = file_get_contents($verFile); + $xmlObj = simplexml_load_string($str); + $version = (string) $xmlObj->version_no; } // pattern check