Keep `civicrm-version.php` up-to-date without running GenCode on all builds
We aim to allow installing CiviCRM on Drupal 8 via composer
/git
without requiring the admin to run GenCode
.
The file civicrm-version.php
is generated by GenCode
. A typical copy looks like this:
<?php
/**
* Get the CiviCRM version.
*/
function civicrmVersion() {
return array(
'version' => '4.7.30',
'cms' => 'Drupal',
'revision' => '4.7.30',
);
}
A simple fix might be:
- Commit the file to
civicrm-core.git
(much like in #1 (closed)). - Update
tools/bin/scripts/set-version.php
to maintain this file. (That script is part of the workflow whenever setup a new release.)
There's one catch: the cms
field varies depending on the local runtime. However, we may be lucky here -- in a cursory check, I only found a couple places that relied on it. The task here would be to take a closer look and potentially remove this element. We'd also need to resolve these stale references to cms
:
-
civicrm.drush.inc
(incivicrm-backdrop-1.x
,civicrm-drupal-6.x
,civicrm-drupal-7.x
,civicrm-drupal-8.x
)- Use constants or functions from Drupal/Drush/Backdrop to detect the active environment.
-
install/index.php
andinstall/template.html
- Remove or rewrite any optional sanity checks that rely on this field.
- Use
$installType
to backfill$civicrm_version['cms']
(like the WordPress conditional does)