...
Code Block |
---|
language | php |
---|
linenumbers | true |
---|
|
/**
* Terminatur
*
* These local settings were generated by terminatur.
* You may see them if you use Kalastack, Kalabox, Proviso or other local dev
* tools.
*
*/
if (isset($_SERVER['KALABOX']) && $_SERVER['KALABOX'] === 'on') {
// DB Array and some common conf.
$databases['default']['default'] = array(
'driver' => 'mysql',
'database' => 'mysite_kala',
'username' => 'root',
'password' => 'password',
'host' => 'localhost',
'port' => '3306',
'prefix' => '',
);
// SetError reporting
some common desirable local vars.
$conf['file_temporary_path'] = '/tmp'; error_reporting(-1); // Have PHP complain about absolutely everything.
$conf['fileerror_public_pathlevel'] = 'sites/default/files';
$conf['file_private_path'] = 'sites/default/files/private';
$conf['reroute_email_enable'] = 1;
$conf['cache'] = 0;
$conf['css_gzip_compression'] = FALSE;
$conf['js_gzip_compression'] = FALSE;2; // Show all messages on your screen
ini_set('display_errors', TRUE); // These lines give you content on WSOD pages.
ini_set('display_startup_errors', TRUE);
// Set some common desirable local vars.
$conf['preprocessfile_temporary_csspath'] = 0'/tmp';
$conf['preprocessfile_public_jspath'] = 0'sites/default/files';
$conf['sitefile_private_namepath'] = 'mysite Localsites/default/files/private';
$conf['cronreroute_email_lastenable'] = '9999999999';
} |
Non-Kalabox
If you aren't on Kalabox, you should setup something similar. Make sure you don't overwrite any of the existing Kalabox settings or Pantheon configuration:
Code Block |
---|
language | php |
---|
linenumbers | true |
---|
|
if (isset($_SERVER['KALABOX']) && $_SERVER['KALABOX'] === 'on') {
// Kalabox stuff from above would be here.
} else {
// Your custom local environment db configuration and the sane defaults
// 1;
$conf['cache'] = 0;
$conf['css_gzip_compression'] = FALSE;
$conf['js_gzip_compression'] = FALSE;
$conf['preprocess_css'] = 0;
$conf['preprocess_js'] = 0;
$conf['site_name'] = 'mysite Local';
$conf['cron_last'] = '9999999999';
} |
Non-Kalabox
If you aren't on Kalabox, you should setup something similar. Make sure you don't overwrite any of the existing Kalabox settings or Pantheon configuration:
Code Block |
---|
language | php |
---|
linenumbers | true |
---|
|
if (isset($_SERVER['KALABOX']) && $_SERVER['KALABOX'] === 'on') {
// Kalabox stuff from above would be here.
} else {
// Your custom local environment db configuration and the sane defaults
// shown in the Kalabox config above should be here.
} |
...
note that there are 2 different ways to check the Pantheon environment, here – one for config, the other for web actions like redirects.
Code Block |
---|
themelanguage | RDark |
---|
language | php |
---|
title | setttings.php |
---|
| <?php
// all other defaults go here
/*
* settings for all environements
*/
// Avoid Image resize threshold error
$conf['image_resize_filter_threshold'] = 1000;
// 7.21+ image hack for text-area images
// http://drupal.stackexchange.com/questions/63226/drupal-7-20-image-styles-return-a-url-with-access-denied
$conf['image_allow_insecure_derivatives'] = TRUE;php | theme | RDark |
---|
title | setttings.php |
---|
|
<?php
// all other defaults go here
/*
* settings for all environements
*/
// Avoid Image resize threshold error
$conf['image_resize_filter_threshold'] = 1000;
// 7.21+ image hack for text-area images
// http://drupal.stackexchange.com/questions/63226/drupal-7-20-image-styles-return-a-url-with-access-denied
$conf['image_allow_insecure_derivatives'] = TRUE;
/**
* Perform web-only operations on Pantheon like redirects
* the $_SERVER array will not exist for the drush-cli
* see http://helpdesk.getpantheon.com/customer/portal/articles/708588
*/
if (isset($_SERVER['PANTHEON_ENVIRONMENT'])) {
/**
* Perform web-only operations on Pantheon like redirects
* the $_SERVER array will not exist for the drush-cli
* see http://helpdesk.getpantheon.com/customer/portal/articles/708588
*/
if (isset( Redirect 404 config to the D6 site to hide D7 development
* REMOVE ME ON LAUNCH
*/
$conf['redrect_404_search'] = 'http://www.mysite.com/search/apachesolr_search';
$conf['redirect_404_redirect'] = 'http://www.mysite.com';
$conf['redirect_404_servers'] = 'http://www.mysite.com';
if($_SERVER['PANTHEON_ENVIRONMENT'])) === 'live') {
/**/ settings for launching *Featured RedirectEvents
404 config to the D6 site to hide D7 development if($_SERVER['HTTP_HOST'] == 'live-mysite.gotpantheon.com'){
* REMOVE ME ON LAUNCH header('HTTP/1.0 301 Moved Permanently');
*/ $conf['redrect_404_search'] = 'header('Location: http://wwwnew.mysite.com/search/apachesolr_search';
$conf['redirect_404_redirect'] = 'http://www.mysite.com';
$conf['redirect_404_servers'] = 'http://www.mysite.com';
if($_SERVER['PANTHEON_ENVIRONMENT'] === 'live') {
// settings for launching Featured Events'. $_SERVER['REQUEST_URI']);
exit();
}
// Events Launch
// Redirect all traffic from the "events" subdomain that is not going to
// an /events/* URI back to www.mysite.com (legacy D6 site).
if($_SERVER['HTTP_HOST'] === 'live-events.mysite.gotpantheon.com'){
header('HTTP/1.0 301 Moved Permanently');
header('Location: http://new.mysite.com'. && !preg_match('/^\/events\/.+/', $_SERVER['REQUEST_URI']) && !preg_match('/^\/event-speaker-details\//', $_SERVER['REQUEST_URI']); exit();
}
// Events Launch
// Redirect all traffic from the "events" subdomain that is not going to
// an /events/* URI back to www.mysite.com (legacy D6 site).
if($_SERVER['HTTP_HOST'] === 'events.mysite.com' && !preg_match('/^\/events\/.+/',&& !preg_match('/^\/sites\/.+/', $_SERVER['REQUEST_URI']) ) {
header('HTTP/1.0 303 Temporary Redirect');
header('Location: http://www.mysite.com'. $_SERVER['REQUEST_URI']) && !preg_match('/^\/event-speaker-details\//', ;
exit();
}
// // full launch
// if (in_array($_SERVER['REQUESTHTTP_URIHOST']) && !preg_match('/^\/sites\/.+/', $_SERVER['REQUEST_URI']) ) {
header('HTTP/1.0 303 Temporary Redirect');
header('Location: http://www.mysite.com'. $_SERVER['REQUEST_URI']);
exit();
}
// // full launch, array(
// 'live-mysite.gotpantheon.com',
// 'mysite.org',
// 'www.mysite.org',
// 'new.mysite.com',
// 'mysite.com',
// ))) {
// if (in_array($_SERVER['HTTP_HOST'], array(header('HTTP/1.0 301 Moved Permanently');
// 'live-mysite.gotpantheon.com',header('Location: http://www.mysite.com'. $_SERVER['REQUEST_URI']);
// 'mysite.org',exit();
// }
'www.mysite.org',
}
// 'new.mysite.com',if($_SERVER['PANTHEON_ENVIRONMENT'] === 'test') {
// 'mysite.com',
// )))if($_SERVER['HTTP_HOST'] == 'test-mysite.gotpantheon.com') {
// header('HTTP/1.0 301 Moved Permanently');
// header('Location: http://wwwtest.mysite.com'. $_SERVER['REQUEST_URI']);
// exit();
// }
}
if if($_SERVER['PANTHEON_ENVIRONMENT'] === 'testdev') {
if($_SERVER['HTTP_HOST'] == 'test-mysite.gotpantheon.com') {
// Error reporting
header('HTTP/1.0 301 Moved Permanently');
header('Location: http://test.mysite.com'. $_SERVER['REQUEST_URI']);
error_reporting(-1); // Have PHP complain about absolutely everything.
$conf['error_level'] = 2; // Show all messages on your screen
exit(ini_set('display_errors', TRUE); // These }
}lines give you content on WSOD pages.
if ini_set($_SERVER['PANTHEON_ENVIRONMENT'] === 'dev') {'display_startup_errors', TRUE);
if($_SERVER['HTTP_HOST'] == 'dev-mysite.gotpantheon.com') {
header('HTTP/1.0 301 Moved Permanently');
header('Location: http://dev.mysite.com'. $_SERVER['REQUEST_URI']);
exit();
}
}
}
/**
* Perform web and drush operations on Pantheon
* see http://helpdesk.getpantheon.com/customer/portal/articles/708588
*/
if (defined('PANTHEON_ENVIRONMENT')) {
/**
* Use Redis for caching AND performance settings
* see http://helpdesk.getpantheon.com/customer/portal/articles/401317-redis
*/
$conf['redis_client_interface'] = 'PhpRedis';
$conf['cache_backends'][] = 'sites/all/modules/contrib/redis/redis.autoload.inc';
$conf['cache_default_class'] = 'Redis_Cache';
// Make sure that we don't have collisions by prefixing the cache keys per environment
$conf['cache_prefix'] = array('default' => 'pantheon-redis-' . $_SERVER['PANTHEON_ENVIRONMENT'] );
// Do not use Redis for cache_form (no performance difference).
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';
// Don't use Redis for Views cache, has caused some display issues.
$conf['cache_class_cache_views'] = 'DrupalDatabaseCache';
$conf['cache_class_cache_views_data'] = 'DrupalDatabaseCache';
// Use Redis for Drupal locks (semaphore).
$conf['lock_inc'] = 'sites/all/modules/contrib/redis/redis.lock.inc';
/**
* Set some configuration settings for DEV, TEST, and LIVE
*/
// Cached page compression - always off.
$conf['page_compression'] = 0;
// Minimum cache lifetime - always none.
$conf['cache_lifetime'] = 0;
// Drupal caching in TEST and LIVE should mostly line up
if (in_array(PANTHEON_ENVIRONMENT, array('test', 'live'))) {
// Anonymous caching
$conf['cache'] = 1;
}
// Some settings in TEST and DEV should be the same
if (in_array(PANTHEON_ENVIRONMENT, array('test', 'dev'))) {
// rules or system messages can email users during testing unless we say no
$conf['reroute_email_enable'] = 1;
// Expiration of cached pages - none.
$conf['page_cache_maximum_age'] = 0;
}
if (PANTHEON_ENVIRONMENT == 'live') {
// Expiration of cached pages - 1 minute.
$conf['page_cache_maximum_age'] = 60; //900
$conf['preprocess_css'] = 1;
$conf['preprocess_js'] = 1;
// $conf['css_gzip_compression'] = TRUE;
// $conf['js_gzip_compression'] = TRUE;
}
if (PANTHEON_ENVIRONMENT == 'test') {
}
if (PANTHEON_ENVIRONMENT == 'dev') {
// Anonymous caching.
$conf['cache'] = 0;
$conf['preprocess_css'] = 0;
$conf['preprocess_js'] = 0;
}
}
/* perform 301 redirects */
// // print_r($_SERVER);
// if($_SERVER['REQUEST_URI'] == '/path/one') {
// header('HTTP/1.0 301 Moved Permanently');
// header('Location: /path/two');
// exit();
// }
//
/**
* Terminatur
*
* These local settings were generated by terminatur.
* You may see them if you use Kalastack, Kalabox, Proviso or other local dev
* tools.
*
*/
if (isset($_SERVER['KALABOX']) && $_SERVER['KALABOX'] === 'on') {
// DB Array and some common conf.
$databases['default']['default'] = array(
'driver' => 'mysql',
'database' => 'mysite_kala',
'username' => 'root',
'password' => 'password',
'host' => 'localhost',
'port' => '3306',
'prefix' => '',
);
// Set some common desirable local vars.
$conf['file_temporary_path'] = '/tmp';
$conf['file_public_path'] = 'sites/default/files';
$conf['file_private_path'] = 'sites/default/files/private';
$conf['reroute_email_enable'] = 1;
$conf['cache'] = 0;
$conf['css_gzip_compression'] = FALSE;
$conf['js_gzip_compression'] = FALSE;
$conf['preprocess_css'] = 0;
$conf['preprocess_js'] = 0;
$conf['site_name'] = 'mysite Local';
$conf['cron_last'] = '9999999999';
}
|
...
Here is an example of D6 settings (note Habitat isnt available for D^, but you can do module disable/enable through the settings.php:
Code Block |
---|
language | php |
---|
theme | RDark | language | php |
---|
|
if (defined('PANTHEON_ENVIRONMENT')) {
if (PANTHEON_ENVIRONMENT == 'dev') {
$conf = array(
'securepages_enable' => FALSE,
'securesite_enabled' => '0',
'preprocess_css' => FALSE,
'preprocess_js' => FALSE,
'reroute_email_enable' => 1,
'fetcher_environment' => 'dev',
);
}
if (PANTHEON_ENVIRONMENT == 'test') {
$conf = array(
'securepages_enable' => FALSE,
'securesite_enabled' => '0',
'preprocess_css' => FALSE,
'preprocess_js' => FALSE,
'reroute_email_enable' => 1,
'fetcher_environment' => 'test',
);
}
if (PANTHEON_ENVIRONMENT == 'live') {
$conf = array(
'securepages_enable' => TRUE,
'securesite_enabled' => '1',
'preprocess_css' => TRUE,
'preprocess_js' => TRUE,
'fetcher_environment' => 'prod',
);
}
} |
...