Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Drupal Settings file router - localhost / etc
/*
* 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';
}
@chrisjlee

This comment has been minimized.

Copy link
Owner Author

chrisjlee commented Sep 22, 2011

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.