*/
class CRM_Core_CodeGen_Config extends CRM_Core_CodeGen_BaseTask {
public function run() {
- $this->generateTemplateVersion();
-
$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(
'backdrop',
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");
}
/**
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':
$candidates[] = "../../civicrm.config.php.wordpress";
$candidates[] = "../WordPress/civicrm.config.php.wordpress";
- $candidates[] = "../drupal/civicrm.config.php.drupal";
break;
}
foreach ($candidates as $candidate) {