Skip to content

Instantly share code, notes, and snippets.

@esolitos
Last active February 19, 2020 13:46
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esolitos/692e1b81209053ae9be5 to your computer and use it in GitHub Desktop.
Save esolitos/692e1b81209053ae9be5 to your computer and use it in GitHub Desktop.
OUTDATED # Devel settings for Drupal + RamsaltMedia platforms - MOVED to https://github.com/esolitos/drupal-utility
This config assumes that:
- `platform.settings.php` is placed in the `sites/` directory
- you have a `sites/files` directory in your drupal installation.
- you have a `ramsalt` user that can access all your databases starting with `ramsalt_`
- the files on the "live" site are placed in the drupal's default directory: `sites/hostname.tld/files`
<?php
/**
* This file contains most of the default settings that otherwise we will have to share among all the Media Sites
*
*/
$conf['site_name'] = '*DEV* '.$site_name;
$conf['site_mail'] = $your_email;
$conf['site_slogan'] = empty($slogan) ? '' : $slogan;
$conf['file_temporary_path'] = 'sites/files/'.$host.'/private/temp';
$conf['file_public_path'] = 'sites/files/'.$host.'/files';
$conf['file_private_path'] = 'sites/files/'.$host.'/private';
if ( $real_host ) {
$real_host_directory = isset($real_host_directory) ? $real_host_directory : $real_host;
if ( isset($real_host_access) )
$conf['stage_file_proxy_origin'] = 'http://'.$real_host_access.'@'.$real_host;
else
$conf['stage_file_proxy_origin'] = 'http://'.$real_host;
$conf['stage_file_proxy_hotlink'] = FALSE;
$conf['stage_file_proxy_origin_dir'] = 'sites/'.$real_host_directory.'/files';
}
$update_free_access = FALSE;
$drupal_hash_salt = 'you-should-really-change-this-but-on-the-other-hand-this-is-a-dev-site';
$conf['cache'] = FALSE;
$conf['block_cache'] = FALSE;
$conf['cache_lifetime'] = 0;
$conf['page_cache_maximum_age'] = 0;
$conf['page_compression'] = FALSE;
$conf['preprocess_css'] = FALSE;
$conf['preprocess_js'] = FALSE;
$conf['css_gzip_compression'] = FALSE;
$conf['js_gzip_compression'] = FALSE;
if (empty($default_db_user)) {
$default_db_user = 'ramsalt';
$default_db_password = 'SUPERSTRONGPASSWORD!! ..or a weak one, it does not matter, I have a firewall..';
}
if (empty($db_host)) {
$db_host = 'localhost';
}
$databases = array (
'default' => array (
'default' => array (
'database' => $db_name,
'username' => $default_db_user,
'password' => $default_db_password,
'host' => $db_host,
'port' => '',
'driver' => 'mysql',
'prefix' => '',
),
),
);
/**
* Ramsalt Media Settings
*/
$conf['move_main_illustration_region'] = 'header';
$conf['main_illustration_gallery_field'] = 'field_image_gallery';
$conf['facebook-page'] = 'ramsaltlab';
$conf['twitter-user-name'] = 'ramsalt';
// Locally turning off SMTP by default
$conf['smtp_on'] = FALSE;
// Disable cron by default
$conf['cron_safe_threshold'] = 0;
// Enable theme debug if required.
$conf['theme_debug'] = isset($enable_theme_debug) ? $enable_theme_debug : FALSE;
$default_theme = ( !empty($custom_theme) ) ? $custom_theme : 'ramsalt_media';
$conf['htmlmail_theme'] = $default_theme;
$conf['mailsystem_theme'] = $default_theme;
$conf['simplenews_from_name'] = $your_email;
$conf['simplenews_test_address'] = $your_email;
$conf['smtp_from'] = $your_email;
$conf['smtp_fromname'] = $conf['site_name'];
$conf['disqus_domain'] = 'disqus';
/**
* PHP settings:
*
*/
$thirty_days = (60*60*24*30);
ini_set('session.gc_probability', 1);
ini_set('session.gc_divisor', 100);
ini_set('session.gc_maxlifetime', $thirty_days);
ini_set('session.cookie_lifetime', $thirty_days);
ini_set('error_reporting', -1);
<?php
/**
* TODO: Base info about this file and its structure.
*
* @author Marlon Saglia
*/
// Set the local hostname for this site, this option is mostly used to generate
// the local public+private files
$host = 'example.media.dev';
// Set the real hostname of the site, it will be used for stage_file_proxy
// set it to any "false" value to disable it.
$real_host = 'example.com';
// This is used if the files are not in the typical
// structure: sites/{$real_host}/files but in a sites/{$real_host_directory}/files
// $real_host_directory = 'live.example.com'
// Set the name of the site (the real one)
$site_name = "This is My New Site";
// if $db_name starts with 'ramsalt_' there's no need for changing db user
// since there's a user `ramsalt` that can access al DBs with that pattern
$db_name = 'ramsalt_example';
// Set this if *ONLY* you're using a custom database config,
// but note that in te 99% of tha cases there's no need to do that!
// $db_host = '';
// $default_db_user = '';
// $default_db_password = '';
// Set only if needed, a default value will be given in the platform.settings
// $custom_theme = '';
// Uncomment the next line to enable theme debuging output.
// More info: https://www.drupal.org/node/223440#theme-debug
// $enable_theme_debug = TRUE;
// if your online host (in this config: $real_host) has an authentication you sould set here the info
// using the format: username:password
// $real_host_access = 'username:password';
/**
* Your Data
* In theory this data is shared among all the local config files
*/
$your_email = 'address@example.com';
// ...and here's the real magic. ;)
require_once dirname(__FILE__).'/../platform.settings.php';
// Other Stuff and overrides, if you REEEALY need to override some settings, this is the place where to do it!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment