Merge pull request #24117 from civicrm/5.52
[civicrm-core.git] / CRM / Core / CodeGen / Config.php
index 9adc75a4434dc51f525e61a0f0fa034cce3a436c..6f6f442f17ba4c167999c3fdc6669497b53e0b1c 100644 (file)
@@ -4,6 +4,7 @@
  * Generate configuration files
  */
 class CRM_Core_CodeGen_Config extends CRM_Core_CodeGen_BaseTask {
+
   public function run() {
     $this->setupCms();
   }
@@ -15,6 +16,7 @@ class CRM_Core_CodeGen_Config extends CRM_Core_CodeGen_BaseTask {
       'drupal8',
       'joomla',
       'wordpress',
+      'standalone',
     ])) {
       echo "Config file for '{$this->config->cms}' not known.";
       exit();
@@ -38,6 +40,10 @@ class CRM_Core_CodeGen_Config extends CRM_Core_CodeGen_BaseTask {
    *   path to config template
    */
   public function findConfigTemplate($cms) {
+    if (getenv('GENCODE_CONFIG_TEMPLATE')) {
+      return getenv('GENCODE_CONFIG_TEMPLATE');
+    }
+
     $candidates = [];
     switch ($cms) {
       case 'backdrop':
@@ -59,6 +65,10 @@ class CRM_Core_CodeGen_Config extends CRM_Core_CodeGen_BaseTask {
         $candidates[] = "../../../modules/civicrm-drupal/civicrm.config.php.drupal";
         break;
 
+      case 'standalone':
+        $candidates[] = "../../../../civicrm.config.php.standalone";
+        break;
+
       case 'wordpress':
         $candidates[] = "../../civicrm.config.php.wordpress";
         $candidates[] = "../WordPress/civicrm.config.php.wordpress";