Skip to content

Instantly share code, notes, and snippets.

@opdavies
Last active January 24, 2017 23:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save opdavies/34a653e7d439c6048ed3 to your computer and use it in GitHub Desktop.
Save opdavies/34a653e7d439c6048ed3 to your computer and use it in GitHub Desktop.
A base settings.php for Drupal 7.
<?php
$databases['default']['default'] = [
'driver' => $_ENV['DB_CONNECTION'],
'host' => $_ENV['DB_HOST'],
'port' => $_ENV['DB_PORT'],
'database' => $_ENV['DB_NAME'],
'username' => $_ENV['DB_USER'],
'password' => $_ENV['DB_PASS'],
];
$base_url = $_ENV['APP_URL'];
// Master settings.
$conf['master_current_scope'] = $_ENV['APP_ENV'];
if ($_ENV['APP_ENV'] == 'local') {
// Show all the errors!
error_log(E_ALL);
$conf['error_level'] = 2;
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
}
// Disable caching.
$conf['cache'] = 0;
$conf['block_cache'] = 0;
$conf['cache_lifetime'] = 0;
$conf['page_cache_maximum_age'] = 0;
$conf['preprocess_css'] = FALSE;
$conf['preprocess_js'] = FALSE;
// Views UI settings.
$conf['views_ui_show_advanced_column'] = TRUE;
$conf['views_ui_show_advanced_help_warning'] = FALSE;
$conf['views_ui_show_listing_filters'] = TRUE;
$conf['views_ui_show_master_display'] = TRUE;
// Devel.
$conf['devel_query_display'] = TRUE;
$conf['devel_raw_names'] = TRUE;
$conf['devel_rebuild_theme_registry'] = TRUE;
// Enable theme debugging.
$conf['theme_debug'] = TRUE;
// Environment indicator.
$conf['environment_indicator_integration'] = ['admin_menu' => 'admin_menu', 'toolbar' => 'toolbar'];
$conf['environment_indicator_favicon_overlay'] = FALSE;
$conf['environment_indicator_git_support'] = FALSE;
$conf['environment_indicator_overwrite'] = TRUE;
$conf['environment_indicator_overwritten_color'] = '#37A5DA';
$conf['environment_indicator_overwritten_name'] = 'Local';
// Disable the Honeypot time limit.
$conf['honeypot_time_limit'] = 0;
// File proxy.
// $conf['stage_file_proxy_origin'] = '';
// $conf['stage_file_proxy_hotlink'] = TRUE;
<?php
/**
* Put private settings, like $databases, in settings.local.php.
*/
$update_free_access = FALSE;
$drupal_hash_salt = '';
ini_set('session.gc_probability', 1);
ini_set('session.gc_divisor', 100);
ini_set('session.gc_maxlifetime', 200000);
ini_set('session.cookie_lifetime', 2000000);
$conf['404_fast_paths_exclude'] = '/\/(?:styles)\//';
$conf['404_fast_paths'] = '/\.(?:txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i';
$conf['404_fast_html'] = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL "@path" was not found on this server.</p></body></html>';
define('SITE_NAME', str_replace('sites/', '', conf_path()));
define('SITE_ENV', 'dev');
$files = array(
'/var/www/common.settings.php',
__DIR__ . DIRECTORY_SEPARATOR . 'local.settings.php',
__DIR__ . DIRECTORY_SEPARATOR . 'master.inc',
);
foreach ($files as $file) {
if (file_exists($file)) {
include $file;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment