Skip to content

Instantly share code, notes, and snippets.

@nstielau
Created November 16, 2011 02:11
Show Gist options
  • Save nstielau/1369057 to your computer and use it in GitHub Desktop.
Save nstielau/1369057 to your computer and use it in GitHub Desktop.
wp-config.php for Wordpress on Pantheon
<?php
// Tweak #1
// Load database settings from PRESSFLOW_SETTINGS environment variable...
$pressflow_settings = json_decode($_SERVER['PRESSFLOW_SETTINGS'], TRUE);
$database_settings = $pressflow_settings['databases']['default']['default'];
/** MySQL configs */
define('DB_NAME', $database_settings['database']);
define('DB_USER', $database_settings['username']);
define('DB_PASSWORD', $database_settings['password']);
define('DB_HOST', $database_settings['host'].":".$database_settings['port']);
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
// Tweak #2
// Sneak in wordpress cookies as Drupal cookies (change prefix from wordpress_ to SESS)
$salt = md5($_SERVER['PRESSFLOW_SETTINGS']);
define('USER_COOKIE', 'SESSuser' . $salt);
define('PASS_COOKIE', 'SESSpass' . $salt);
define('AUTH_COOKIE', 'SESSauth' . $salt);
define('SECURE_AUTH_COOKIE', 'SESSsecure' . $salt);
define('LOGGED_IN_COOKIE', 'SESSloggedin' . $salt);
define('TEST_COOKIE', 'SESStest' . $salt);
// Standard wp-config.php from here on down.
define('AUTH_KEY', 'put your unique phrase here');
define('SECURE_AUTH_KEY', 'put your unique phrase here');
define('LOGGED_IN_KEY', 'put your unique phrase here');
define('NONCE_KEY', 'put your unique phrase here');
define('AUTH_SALT', 'put your unique phrase here');
define('SECURE_AUTH_SALT', 'put your unique phrase here');
define('LOGGED_IN_SALT', 'put your unique phrase here');
define('NONCE_SALT', 'put your unique phrase here');
$table_prefix = 'wp_';
define('WPLANG', '');
define('WP_DEBUG', false);
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
require_once(ABSPATH . 'wp-settings.php');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment