Last active
September 27, 2015 07:47
-
-
Save chrisjlee/1235389 to your computer and use it in GitHub Desktop.
Drupal Settings file router - localhost / etc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* At the end of the settings.php file for drupal add these lines | |
*/ | |
/* | |
* Settings file routing | |
*/ | |
if (file_exists(dirname(__FILE__) . '/local.settings.php')) { | |
include dirname(__FILE__) . '/local.settings.php'; | |
} | |
if (file_exists(dirname(__FILE__) . '/stage.settings.php')) { | |
include dirname(__FILE__) . '/stage.settings.php'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use this to reroute and redefine your local settings. Inspired by a drupal.stackexchange answer here: http://drupal.stackexchange.com/questions/9/suggestions-for-settings-php-local-dev-development-server-live-server/41#41
Examples of local.settings.php
For good examples of what a local.settings should look like check out:
Quick installation
curl https://gist.github.com/chrisjlee/1235389/raw/e8c083eedea71fa9c1c86ccba126771cfbc956e5/settings-router.php | sudo tee -a sites/default/settings.php