changing settings.php after the subsite is created through AEgir

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
drup_lr's picture

Everything works fine with AEgir but i would like to change the settings.php once the verify is completed . dynamically i want to add db_prefix to my settings.php . please advise me

Comments

Aegir does not support

mig5's picture

Aegir does not support db_prefixes. What you want to do (modify the settings.php dynamically) isn't impossible, but don't use db_prefixes.

But for general manipulation/adding to the settings.php, it is possible to modify the settings.php of a site on verify by making a file in /var/aegir/config/includes/global.inc with something like this:

$thishost = $_SERVER[HTTP_HOST];
if(preg_match("/(dev.mysite.net)/", $thishost)) {
  //  add custom stuff here such as $conf['maintenance_theme'] = 'my_theme';
}

This will get read in on verify and included into the settings.php of the relevant site.

thank you

drup_lr's picture

This i was helpful to me , i have one more question is there a way we can add this code dynamically after the site is created through Aegir.

Aegir hosting system

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: