X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FCodeGen%2FConfig.php;h=086169ff5264670ca210f16821b85e118cb82803;hb=46bcf5978e35c7f061b3ce70f98108df028eef1d;hp=de7ae4b99a6240a529be0e8f74bb3b8c84d1a291;hpb=bada0f6668a8f2b1dd3210b7ecfa81db50e9f76d;p=civicrm-core.git diff --git a/CRM/Core/CodeGen/Config.php b/CRM/Core/CodeGen/Config.php index de7ae4b99a..086169ff52 100644 --- a/CRM/Core/CodeGen/Config.php +++ b/CRM/Core/CodeGen/Config.php @@ -4,17 +4,17 @@ * Generate configuration files */ class CRM_Core_CodeGen_Config extends CRM_Core_CodeGen_BaseTask { - function run() { + public function run() { $this->generateTemplateVersion(); $this->setupCms(); } - function generateTemplateVersion() { + public function generateTemplateVersion() { file_put_contents($this->config->tplCodePath . "/CRM/common/version.tpl", $this->config->db_version); } - function setupCms() { + public function setupCms() { if (!in_array($this->config->cms, array( 'drupal', 'joomla', 'wordpress'))) { echo "Config file for '{$this->config->cms}' not known."; @@ -25,7 +25,8 @@ class CRM_Core_CodeGen_Config extends CRM_Core_CodeGen_BaseTask { if ($configTemplate) { echo "Generating civicrm.config.php\n"; copy($configTemplate, '../civicrm.config.php'); - } else { + } + else { throw new Exception("Failed to locate template for civicrm.config.php"); } } @@ -38,7 +39,8 @@ class CRM_Core_CodeGen_Config extends CRM_Core_CodeGen_BaseTask { } /** - * @param string $cms "drupal"|"wordpress" + * @param string $cms + * "drupal"|"wordpress". * @return null|string path to config template */ public function findConfigTemplate($cms) { @@ -46,8 +48,9 @@ class CRM_Core_CodeGen_Config extends CRM_Core_CodeGen_BaseTask { switch ($cms) { case 'drupal': $candidates[] = "../drupal/civicrm.config.php.drupal"; - $candidates[] = "../../drupal/civicrm.config.php.drupal"; + $candidates[] = "../../drupal/civicrm.config.php.drupal"; break; + case 'wordpress': $candidates[] = "../../civicrm.config.php.wordpress"; $candidates[] = "../WordPress/civicrm.config.php.wordpress";