-
-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dev/civicrm-setup#11 Remove templates/CRM/common/version.tpl #11695
Conversation
ping @totten @seamuslee001 |
On the other hand I am not sure, why we need to have generated /**
* Return the running civicrm version.
*
* @return string
* civicrm version
*/
public static function version() {
static $version;
if (!$version) {
$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)) {
CRM_Core_Error::fatal('Unknown codebase version.');
}
}
return $version;
} If we approve this, then we no longer need CRM_Core_CodeGen_Version file and also resolve civicrm/civicrm-setup#12 Or am I missing something here ? |
Based on grepping the known Let me @monishdeb, I'm glad you mentioned the point about reading |
(CiviCRM Review Template WORD-1.0)
|
Oh, technically, deleting a file is tricky (which is why I'd say the main thing needed to merge is to clean-up the description a bit. But if you also think it's good to update |
@totten I have updated the PR description and I didn't create JIRA issue for this PR as I saw somewhere (maybe on mergers channel) that having JIRA for each PR isn't necessary until and unless it got references to relate with and has milestone set. In this case, I was not able to choose milestone as it only got 4.7.31. For future PRs on civicrm-setup issues, I will make sure to have corresponding JIRA ticket |
Thank you! Agree we don't need a JIRA issue -- we're just at a funny transitional moment because we haven't fully replaced the I made a few more copy-edits on the description. The new test failures are common false-negatives. |
Overview
For civicrm/civicrm-setup#11, the aim is to install the database schema without needing to run
GenCode
-- andtemplates/CRM/common/version.tpl
is generated to byGenCode
as an intermediate step toward producingcivicrm-version.php
(revision
). This PR removestemplates/CRM/common/version.tpl
.If you grep universe, no other projects reference
CRM/common/version.tpl
. It's only used to hold the Civi version later assigned to$svnversion
/revision
. In turn, no other projects reference therevision
field.Before
CRM_Core_CodeGen_Version
writes the Civi version totemplates/CRM/common/version.tpl
CRM_Core_CodeGen_Version
evaluatesxml/civicrm_version.tpl
andtemplates/CRM/common/version.tpl
-- and writes the content tocivicrm-version.php
.After
templates/CRM/common/version.tpl
has been thoroughly removed:CRM_Core_CodeGen_Version
does not write the Civi version totemplates/CRM/common/version.tpl
xml/civicrm_version.tpl
does not consumetemplates/CRM/common/version.tpl
or output an$svnVersion
/revision
. (Therevision
is not referenced elsewhere inuniverse
.)CRM_Utils_Check_Component_Source::getRemovedFiles()
ensures that the file is no longer present in the codebase..gitignore
civicrm-version.php
is still available for consumption byCRM_Utils_System::version()
and others.