I could see this being useful for something like http://drupal.org/project/environment_indicator

Here are the scenarios:

  1. If the settings file doesn't exist, add the variable.
  2. If the settings file exists and doesn't contain the variable, add it
  3. If the settings file exists and contains an outdated variable, update it.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tim.plunkett’s picture

Status: Active » Needs review
FileSize
1.01 KB

This may not be the best place for this, ideally there would be a way to add in more conf variables like this programmatically.
Borrowing the regex approach used in #1798262: Clear out config directories in drush site-install

tim.plunkett’s picture

Needs code comments, but looking for feedback on the approach before doing that.

tim.plunkett’s picture

FileSize
1.77 KB

Added some comments anyway.

tizzo’s picture

I think what we really want to do is indicate the environment *that you are in* and not the environment you have synced from. At some point we should also get rid of the settings.php template and replace it with a dynamically generated string like I did with the aliases file generation.

tim.plunkett’s picture

FileSize
7.45 KB

Agreed.
This will only work when no settings.php file exists, I'll create a follow-up issue for that as it is out of scope here.

tizzo’s picture

I also created #1878294: Generate settings.php dynamically without using a template to track dynamically generating settings.php.

tizzo’s picture

Status: Needs review » Needs work
+++ b/KEYS.txtundefined
@@ -23,7 +23,8 @@ TODO: Find a good way to expose database options as command line arguments where
+  - 'environment.remote' - The environment currently selected by this site object.

I feel like it would be clearer to say something like: "The remote environment currently selected for synchronization operations." and "The environment that this instance of the site is running in or where it is being installed (defaults to `local` for local development).

tim.plunkett’s picture

Status: Needs work » Needs review
FileSize
1 KB
7.43 KB
tizzo’s picture

Status: Needs review » Reviewed & tested by the community
tizzo’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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