Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jeffam/1a616d43b0913555b9ef to your computer and use it in GitHub Desktop.
Save jeffam/1a616d43b0913555b9ef to your computer and use it in GitHub Desktop.
Drupal 7 settings.local.php patch
diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php
index 580cc38..ae5c1ed 100644
--- a/sites/default/default.settings.php
+++ b/sites/default/default.settings.php
@@ -551,3 +551,18 @@ $conf['404_fast_html'] = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
* Remove the leading hash signs to disable.
*/
# $conf['allow_authorize_operations'] = FALSE;
+
+/**
+ * Load local development override configuration, if available.
+ *
+ * Use settings.local.php to override variables on secondary (staging,
+ * development, etc) installations of this site. Typically used to disable
+ * caching, JavaScript/CSS compression, re-routing of outgoing e-mails, and
+ * other things that should not happen on development and testing sites.
+ *
+ * Keep this code block at the end of this file to take full effect.
+ */
+$conf_path = conf_path();
+if (file_exists(DRUPAL_ROOT . '/' . $conf_path . '/settings.local.php')) {
+ include DRUPAL_ROOT . '/' . $conf_path . '/settings.local.php';
+}
diff --git a/sites/default/example.settings.local.php b/sites/default/example.settings.local.php
new file mode 100644
index 0000000..d6c3f22
--- /dev/null
+++ b/sites/default/example.settings.local.php
@@ -0,0 +1,25 @@
+<?php
+$databases = array (
+ 'default' =>
+ array (
+ 'default' =>
+ array (
+ 'database' => '',
+ 'username' => '',
+ 'password' => '',
+ 'host' => '127.0.0.1',
+ 'port' => '',
+ 'driver' => 'mysql',
+ 'prefix' => '',
+ ),
+ ),
+);
+
+// Other stuff useful during development
+
+// Disable cache
+$conf['cache'] = 0;
+
+// Disable css and javascript aggregation by default
+$conf['preprocess_css'] = 0;
+$conf['preprocess_js'] = 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment