Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I could see this being useful for something like http://drupal.org/project/environment_indicator
Here are the scenarios:
- If the settings file doesn't exist, add the variable.
- If the settings file exists and doesn't contain the variable, add it
- If the settings file exists and contains an outdated variable, update it.
Comment | File | Size | Author |
---|---|---|---|
#8 | fetcher-1878120-8.patch | 7.43 KB | tim.plunkett |
#8 | interdiff.txt | 1 KB | tim.plunkett |
#5 | fetcher-1878120-5.patch | 7.45 KB | tim.plunkett |
#3 | fetcher-1878120-3.patch | 1.77 KB | tim.plunkett |
#1 | fetcher-1878120-1.patch | 1.01 KB | tim.plunkett |
Comments
Comment #1
tim.plunkettThis 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
Comment #2
tim.plunkettNeeds code comments, but looking for feedback on the approach before doing that.
Comment #3
tim.plunkettAdded some comments anyway.
Comment #4
tizzo CreditAttribution: tizzo commentedI 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.
Comment #5
tim.plunkettAgreed.
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.
Comment #6
tizzo CreditAttribution: tizzo commentedI also created #1878294: Generate settings.php dynamically without using a template to track dynamically generating settings.php.
Comment #7
tizzo CreditAttribution: tizzo commentedI 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).
Comment #8
tim.plunkettComment #9
tizzo CreditAttribution: tizzo commentedComment #10
tizzo CreditAttribution: tizzo commentedCommitted, thanks!