Our scenario is we have highly customized settings.php that loads config data programmatically rather than it being stored directly in the settings.php. In fact, we only have 1 settings.php for all of our drupal sites on our server (all are symlinked to one file)

The problem we run into is during our build script process we kick off automated site builds using drush si ... Every one of these adds this line to the bottom of our global settings.php file:

$conf['install_profile'] = 'blah';

After a few months we have thousands of these lines that we have to remember to go clean out. Very annoying. Aside from removing permissions from this file, is there any way to prevent this?

also, i'm guessing this is a bug (the check string and insert string don't match:

    if (strpos($contents, "\$conf['profile']") === FALSE) {
      $install_profile_config = "\$conf['install_profile'] = '$profile';";
      $appended = file_put_contents($settingsfile, "\n" . $install_profile_config . "\n", FILE_APPEND);


moshe weitzman’s picture

Status:Active» Fixed

Fixed the comparison bug, and added an is_writable() check. I think that removes most of the pain here, so closing.

joelcollinsdc’s picture

you are a true american hero. thank you!

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.