X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FCodeGen%2FConfig.php;h=c01834d3bbcdcdfd3329246be400f207734bc1ba;hb=dc5f6c5060fb0fa3b6a5fa0e2a3bc265150da891;hp=90cb4151fcb7ea133054697533ce95e4afa27e0f;hpb=ae0b9f613a9d7bd38b28cbda07cb15eb7497e6b5;p=civicrm-core.git diff --git a/CRM/Core/CodeGen/Config.php b/CRM/Core/CodeGen/Config.php index 90cb4151fc..aa50e05957 100644 --- a/CRM/Core/CodeGen/Config.php +++ b/CRM/Core/CodeGen/Config.php @@ -4,24 +4,19 @@ * Generate configuration files */ class CRM_Core_CodeGen_Config extends CRM_Core_CodeGen_BaseTask { - public function run() { - $this->generateTemplateVersion(); + public function run() { $this->setupCms(); } - public function generateTemplateVersion() { - file_put_contents($this->config->tplCodePath . "/CRM/common/version.tpl", $this->config->db_version); - } - public function setupCms() { - if (!in_array($this->config->cms, array( + if (!in_array($this->config->cms, [ 'backdrop', 'drupal', 'drupal8', 'joomla', 'wordpress', - ))) { + ])) { echo "Config file for '{$this->config->cms}' not known."; exit(); } @@ -35,12 +30,6 @@ class CRM_Core_CodeGen_Config extends CRM_Core_CodeGen_BaseTask { throw new Exception("Failed to locate template for civicrm.config.php"); } } - - echo "Generating civicrm-version file\n"; - $template = new CRM_Core_CodeGen_Util_Template('php'); - $template->assign('db_version', $this->config->db_version); - $template->assign('cms', ucwords($this->config->cms)); - $template->run('civicrm_version.tpl', $this->config->phpCodePath . "civicrm-version.php"); } /** @@ -50,7 +39,11 @@ class CRM_Core_CodeGen_Config extends CRM_Core_CodeGen_BaseTask { * path to config template */ public function findConfigTemplate($cms) { - $candidates = array(); + if (getenv('GENCODE_CONFIG_TEMPLATE')) { + return getenv('GENCODE_CONFIG_TEMPLATE'); + } + + $candidates = []; switch ($cms) { case 'backdrop': // FIXME!!!! @@ -68,6 +61,7 @@ class CRM_Core_CodeGen_Config extends CRM_Core_CodeGen_BaseTask { case 'drupal8': $candidates[] = "../../modules/civicrm/civicrm.config.php.drupal"; $candidates[] = "../../../modules/civicrm/civicrm.config.php.drupal"; + $candidates[] = "../../../modules/civicrm-drupal/civicrm.config.php.drupal"; break; case 'wordpress':