CRM-21787 : Simplify CRM_Utils_System::version() to fetch version directly from xml/version.xml #11700
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This patch simplifies
CRM_Utils_System::version()
by removing a level of indirection -- instead of readingxml/version.xml
indirectly (by way ofcivicrm-version.php
andGenCode
), it readsxml/version.xml
directly.This change is valid now that
xml/version.xml
is included with tarballs (04e5df1).Before
CRM_Utils_System::version()
readscivicrm-version.php
ORxml/version.xml
.After
CRM_Utils_System::version()
readsxml/version.xml
.Technical Details
To avoid(Outside scope of this PR.)CRM_Core_CodeGen_Version
dependency to generatecivicrm-version.php
is to make this file independent, to retrieve the cms and version on its own. For version, it's possible to directly usexml/version.xml
but for cms we need to rely on php constant CIVICRM_UF. Then we can easily removeCRM_Core_CodeGen_Version
.Comments
This PR contains commits of #11695
civicrm-version.php
up-to-date without running GenCode on all builds