* 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.";
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");
}
}
}
/**
- * @param string $cms "drupal"|"wordpress"
+ * @param string $cms
+ * "drupal"|"wordpress".
* @return null|string path to config template
*/
public function findConfigTemplate($cms) {
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";