Skip to content

Instantly share code, notes, and snippets.

Last active September 27, 2015 07:47
  • Star 7 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
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';
Copy link

Use this to reroute and redefine your local settings. Inspired by a drupal.stackexchange answer here:

Examples of local.settings.php

For good examples of what a local.settings should look like check out:

Quick installation

curl | 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