Skip to content

Instantly share code, notes, and snippets.

@labboy0276
Last active January 24, 2016 15:05
Show Gist options
  • Save labboy0276/60daacf598573061e168 to your computer and use it in GitHub Desktop.
Save labboy0276/60daacf598573061e168 to your computer and use it in GitHub Desktop.
Drupal 8 Local Settings for using with Pantheon based D8 site
<?php
/**
* @file
* Local development override configuration feature.
*
* To activate this feature, copy and rename it such that its path plus
* filename is 'sites/default/settings.local.php'. Then, go to the bottom of
* 'sites/default/settings.php' and uncomment the commented lines that mention
* 'settings.local.php'.
*
* If you are using a site name in the path, such as 'sites/example.com', copy
* this file to 'sites/example.com/settings.local.php', and uncomment the lines
* at the bottom of 'sites/example.com/settings.php'.
*/
// DB connection to localhost
$databases['default']['default'] = array(
'driver' => 'mysql',
'database' => 'bakers',
'username' => 'root',
'password' => '',
'host' => 'localhost',
'prefix' => '',
);
if (isset($_ENV['PANTHEON_ENVIRONMENT'])) {
$settings['hash_salt'] = $_ENV['DRUPAL_HASH_SALT'];
}
$settings['file_private_path'] = 'sites/default/files/private';
// Check to see if we are serving an installer page.
$is_installer_url = (strpos($_SERVER['SCRIPT_NAME'], '/core/install.php') === 0);
/**
* Add the Drupal 8 CMI Directory Information directly in settings.php to make sure
* Drupal knows all about that.
*
* Issue: https://github.com/pantheon-systems/drops-8/issues/2
*
* IMPORTANT SECURITY NOTE: The configuration paths set up
* below are secure when running your site on Pantheon. If you
* migrate your site to another environment on the public internet,
* you should relocate these locations. See "After Installation"
* at https://www.drupal.org/node/2431247
*
*/
if ($is_installer_url) {
$config_directories = array(
CONFIG_SYNC_DIRECTORY => 'sites/default/files',
);
}
else {
$config_directories = array(
CONFIG_SYNC_DIRECTORY => 'sites/default/config',
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment