Skip to content

Instantly share code, notes, and snippets.

@ericatkinson
Forked from leevigraham/config_bootstrap.php
Created November 8, 2011 15:08
Show Gist options
  • Select an option

  • Save ericatkinson/1347978 to your computer and use it in GitHub Desktop.

Select an option

Save ericatkinson/1347978 to your computer and use it in GitHub Desktop.

Revisions

  1. ericatkinson revised this gist Nov 8, 2011. No changes.
  2. @leevigraham leevigraham revised this gist Apr 19, 2011. 1 changed file with 9 additions and 4 deletions.
    13 changes: 9 additions & 4 deletions config_bootstrap.php
    Original file line number Diff line number Diff line change
    @@ -20,7 +20,7 @@
    * @author Leevi Graham <http://leevigraham.com>
    * @link http://expressionengine.com/index.php?affiliate=leevigraham&page=wiki/EE_2_Config_Overrides/
    * @link http://eeinsider.com/blog/eeci-2010-how-erskine-rolls-with-ee/ - Hat tip to: Erskine from EECI2010 Preso
    * @version 1.4
    * @version 1.5
    *
    * == Changelog ==
    *
    @@ -41,7 +41,9 @@
    *
    * Version 1.4
    * - Updated NSM .htaccess path. v1.1.0 of the addon requires the config setting to be an array
    *
    * Version 1.5
    * - Added global:404_entry_id
    */

    // Setup the environment
    @@ -163,8 +165,11 @@
    'global:google_analytics_key' => false,

    // NSM Gravatar
    'global:nsm_gravatar_default_avatar' => NSM_SITE_URL . '/uploads/member/avatars/default.png'
    );
    'global:nsm_gravatar_default_avatar' => NSM_SITE_URL . '/uploads/member/avatars/default.png',

    // Store the entry_id for the 404 page
    'global:404_entry_id' => '2',
    );

    // Make this global so we can add some of the config variables here
    global $assign_to_config;
  3. @leevigraham leevigraham revised this gist Apr 1, 2011. 1 changed file with 6 additions and 2 deletions.
    8 changes: 6 additions & 2 deletions config_bootstrap.php
    Original file line number Diff line number Diff line change
    @@ -20,7 +20,7 @@
    * @author Leevi Graham <http://leevigraham.com>
    * @link http://expressionengine.com/index.php?affiliate=leevigraham&page=wiki/EE_2_Config_Overrides/
    * @link http://eeinsider.com/blog/eeci-2010-how-erskine-rolls-with-ee/ - Hat tip to: Erskine from EECI2010 Preso
    * @version 1.1
    * @version 1.4
    *
    * == Changelog ==
    *
    @@ -38,6 +38,10 @@
    *
    * Version 1.3
    * - Added encryption key
    *
    * Version 1.4
    * - Updated NSM .htaccess path. v1.1.0 of the addon requires the config setting to be an array
    */

    // Setup the environment
    @@ -271,7 +275,7 @@
    'encryption_key' => '',

    // NSM htaccess Generator
    'nsm_htaccess_generator_path' => NSM_BASEPATH . "/content/.htaccess"
    'nsm_htaccess_generator_path' => array(NSM_BASEPATH . "/content/.htaccess")
    );


  4. @leevigraham leevigraham revised this gist Mar 22, 2011. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion config_bootstrap.php
    Original file line number Diff line number Diff line change
    @@ -35,6 +35,9 @@
    *
    * Version 1.2
    * - Removed $_GET and $_POST parsing. You should use Mo Variables instead. https://github.com/rsanchez/mo_variables
    *
    * Version 1.3
    * - Added encryption key
    */

    // Setup the environment
    @@ -264,8 +267,11 @@
    'captcha_path' => NSM_BASEPATH . '/content/'.NSM_SYSTEM_FOLDER.'/images/captchas/',
    'captcha_url' => NSM_SITE_URL.'/'.NSM_SYSTEM_FOLDER.'/images/captchas/',

    // Encryption / Session key
    'encryption_key' => '',

    // NSM htaccess Generator
    'nsm_htaccess_generator_path' => NSM_BASEPATH . "/content/.htaccess",
    'nsm_htaccess_generator_path' => NSM_BASEPATH . "/content/.htaccess"
    );


  5. @leevigraham leevigraham revised this gist Feb 11, 2011. 1 changed file with 5 additions and 11 deletions.
    16 changes: 5 additions & 11 deletions config_bootstrap.php
    Original file line number Diff line number Diff line change
    @@ -32,6 +32,9 @@
    * - Make $_GET array available as global vars with 'get:' prefix
    * - Added more inline commenting
    * - Swapped order of system config and global vars
    *
    * Version 1.2
    * - Removed $_GET and $_POST parsing. You should use Mo Variables instead. https://github.com/rsanchez/mo_variables
    */

    // Setup the environment
    @@ -156,15 +159,6 @@
    'global:nsm_gravatar_default_avatar' => NSM_SITE_URL . '/uploads/member/avatars/default.png'
    );

    // Turn $_GET into global variables
    foreach ($_GET as $key => $value)
    $default_global_vars['get:' . $key] = $value;

    // Turn $_GET into global variables
    foreach ($_POST as $key => $value)
    if(!is_array($value))
    $default_global_vars['post:' . $key] = $value;

    // Make this global so we can add some of the config variables here
    global $assign_to_config;

    @@ -203,8 +197,8 @@
    'is_site_on' => 'y',
    'site_404' => 'site/four04',

    'webmaster_email' => 'admin@' . NSM_SERVER_NAME,
    'webmaster_name' => 'Admin',
    'webmaster_email' => 'webmaster@' . NSM_SERVER_NAME,
    'webmaster_name' => 'Webmaster',

    // Localization preferences
    'server_timezone' => 'UP10',
  6. @leevigraham leevigraham revised this gist Dec 16, 2010. 1 changed file with 266 additions and 208 deletions.
    474 changes: 266 additions & 208 deletions config_bootstrap.php
    Original file line number Diff line number Diff line change
    @@ -1,40 +1,52 @@
    <?php

    /**
    * Custom configuration bootsrtap file for ExpressionEngine
    *
    * Place config.php in your site root
    * Add require(realpath(dirname(__FILE__) . '/../../config.php')); to the bottom of system/expressionengine/config/config.php
    * Add require(realpath(dirname(__FILE__) . '/../../config.php')); to the bottom of system/expressionengine/config/database.php
    * If you have moved your site root you'll need to update the require_once path
    *
    * Also includes custom DB configuration file based on your environment
    *
    * Posiible DB configuration options
    *
    * $env_db_config['hostname'] = "";
    * $env_db_config['username'] = "";
    * $env_db_config['password'] = "";
    * $env_db_config['database'] = "";
    *
    * @author Leevi Graham <http://leevigraham.com>
    * @link http://expressionengine.com/index.php?affiliate=leevigraham&page=wiki/EE_2_Config_Overrides/
    * @link http://eeinsider.com/blog/eeci-2010-how-erskine-rolls-with-ee/ - Hat tip to: Erskine from EECI2010 Preso
    */
    * Custom configuration bootsrtap file for ExpressionEngine
    *
    * Place config.php in your site root
    * Add require(realpath(dirname(__FILE__) . '/../../config.php')); to the bottom of system/expressionengine/config/config.php
    * Add require(realpath(dirname(__FILE__) . '/../../config.php')); to the bottom of system/expressionengine/config/database.php
    * If you have moved your site root you'll need to update the require_once path
    *
    * Also includes custom DB configuration file based on your environment
    *
    * Posiible DB configuration options
    *
    * $env_db_config['hostname'] = "";
    * $env_db_config['username'] = "";
    * $env_db_config['password'] = "";
    * $env_db_config['database'] = "";
    *
    * @author Leevi Graham <http://leevigraham.com>
    * @link http://expressionengine.com/index.php?affiliate=leevigraham&page=wiki/EE_2_Config_Overrides/
    * @link http://eeinsider.com/blog/eeci-2010-how-erskine-rolls-with-ee/ - Hat tip to: Erskine from EECI2010 Preso
    * @version 1.1
    *
    * == Changelog ==
    *
    * Version 1.1
    * - Changed 'gv_' to 'global:'
    * - Added {global:cm_subscriber_list_slug} for campaignmonitor.com integration
    * - Added {global:google_analytics_key} for Google Analytics integration
    * - Make $_POST array available as global vars with 'post:' prefix
    * - Make $_GET array available as global vars with 'get:' prefix
    * - Added more inline commenting
    * - Swapped order of system config and global vars
    */

    // Setup the environment
    if(!defined('NSM_ENV'))
    {
    define('NSM_SERVER_NAME', $_SERVER['SERVER_NAME']);
    define('NSM_SITE_URL', 'http://'.NSM_SERVER_NAME);
    define('NSM_DOC_ROOT', dirname(__FILE__));
    define('NSM_SYSTEM_FOLDER', 'ee-admin');

    // Set the environment
    if ( strstr( NSM_SERVER_NAME, 'local.' ) ) define('NSM_ENV', 'local');
    elseif( strstr( NSM_SERVER_NAME, 'dev.' ) ) define('NSM_ENV', 'dev');
    elseif( strstr( NSM_SERVER_NAME, 'stage.' ) ) define('NSM_ENV', 'stage');
    elseif( strstr( NSM_SERVER_NAME, 'mobile.' ) ) define('NSM_ENV', 'mobile');
    else define('NSM_ENV', 'production');
    if(!defined('NSM_ENV')) {
    define('NSM_SERVER_NAME', $_SERVER['SERVER_NAME']);
    define('NSM_SITE_URL', 'http://'.NSM_SERVER_NAME);
    define('NSM_BASEPATH', dirname(__FILE__));
    define('NSM_SYSTEM_FOLDER', 'ee-admin');

    // Set the environment
    if ( strstr( NSM_SERVER_NAME, 'local.' ) ) define('NSM_ENV', 'local');
    elseif( strstr( NSM_SERVER_NAME, 'dev.' ) ) define('NSM_ENV', 'development');
    elseif( strstr( NSM_SERVER_NAME, 'stage.' ) ) define('NSM_ENV', 'staging');
    elseif( strstr( NSM_SERVER_NAME, 'm.' ) ) define('NSM_ENV', 'mobile');
    else define('NSM_ENV', 'production');
    }

    // Define the environment settings
    @@ -43,188 +55,234 @@
    $env_db_config = array();
    $env_global_vars = array();

    /* Set the environmental config and global vars */

    // Local
    if (NSM_ENV == 'local'){
    $env_db_config = array(
    'hostname' => 'localhost',
    'username' => 'root',
    'password' => '',
    'database' => 'your_db',
    );
    // $env_global_vars = array();
    // Set the environmental config and global vars
    if (NSM_ENV == 'local') {
    $env_db_config = array(
    'hostname' => '',
    'username' => '',
    'password' => '',
    'database' => '',
    );
    $env_global_vars = array(
    'global:cm_subscriber_list_slug' => ''
    );
    }

    // Development
    elseif(NSM_ENV == 'dev'){}

    // Staging
    elseif(NSM_ENV == 'stage'){}

    // Mobile site example
    elseif(NSM_ENV == 'mobile'){
    // If the environment is mobile we'll load a different template path
    // * Files must be saved as templates
    // * Template Groups / Templates must be the same
    $env_config['tmpl_file_basepath'] = NSM_DOC_ROOT . '/templates_mobile/';
    elseif(NSM_ENV == 'development') {
    $env_db_config = array(
    'hostname' => '',
    'username' => '',
    'password' => '',
    'database' => '',
    );
    $env_global_vars = array();
    }
    elseif(NSM_ENV == 'staging') {
    $env_db_config = array(
    'hostname' => '',
    'database' => '',
    'username' => '',
    'password' => '',
    );
    $env_global_vars = array(
    'global:cm_subscriber_list_slug' => ''
    );
    }
    elseif(NSM_ENV == 'mobile') {
    $env_db_config = array(
    'hostname' => '',
    'username' => '',
    'password' => '',
    'database' => '',
    );
    $env_config['tmpl_file_basepath'] = NSM_BASEPATH . '/templates_mobile/';
    }
    else {
    $env_global_vars = array(
    'global:cm_subscriber_list_slug' => '',
    'global:google_analytics_key' => 'XX-XXXX'
    );
    }

    // Live site
    else{}

    // Config bootsrap... GO!
    if(isset($config))
    {
    // Our default config. This shouldn't have to be changed if you're using the Newism EE2 template.
    $default_config = array(

    // General preferences
    'is_system_on' => 'y',
    'license_number' => '',
    'site_index' => '',
    'admin_session_type' => 'cs',
    'new_version_check' => 'y',
    'doc_url' => 'http://expressionengine.com/user_guide/',

    'site_url' => NSM_SITE_URL,
    'cp_url' => NSM_SITE_URL.'/'.NSM_SYSTEM_FOLDER.'/index.php',

    // Set this so we can use query strings
    'uri_protocol' => 'PATH_INFO',

    // Datbase preferences
    'db_debug' => 'n',
    'pconnect' => 'n',
    'enable_db_caching' => 'n',

    // Site preferences
    // Some of these preferences might actually need to be set in the index.php files.
    // Not sure which ones yet, I'll figure that out when I have my first MSM site.
    'is_site_on' => 'y',
    'site_name' => 'EE Template',
    'site_short_name' => 'default_site',
    'site_description' => '',
    'site_404' => 'site/four04',

    //'webmaster_email' => 'admin@' . NSM_SERVER_NAME,
    //'webmaster_name' => 'Admin',

    // Localization preferences
    'server_timezone' => 'UP10',
    'server_offset' => FALSE,
    'time_format' => 'eu',
    'daylight_savings' => 'n',
    'honor_entry_dst' => 'y',

    // Channel preferences
    'word_separator' => 'dash',
    'reserved_category_word' => 'cat',

    // Template preferences
    'strict_urls' => 'y',
    'save_tmpl_files' => 'y',
    'save_tmpl_revisions' => 'y',
    'tmpl_file_basepath' => NSM_DOC_ROOT . '/templates/',

    // Theme preferences
    'theme_folder_path' => NSM_DOC_ROOT . '/content/themes/',
    'theme_folder_url' => NSM_SITE_URL . '/themes/',

    // Tracking preferences
    'enable_online_user_tracking' => 'n',
    'dynamic_tracking_disabling' => '500',
    'enable_hit_tracking' => 'n',
    'enable_entry_view_tracking' => 'n',
    'log_referrers' => 'n',

    // Member preferences
    'allow_registration' => 'n',
    'profile_trigger' => '--sdjhkj2lffgrerfvmdkndkfisolmfmsd',

    'prv_msg_upload_path' => NSM_DOC_ROOT . '/content/uploads/member/prv_messages',
    'enable_emoticons' => 'n',

    'enable_avatars' => 'n',
    'avatar_path' => NSM_DOC_ROOT . '/content/uploads/member/avatars/',
    'avatar_url' => NSM_SITE_URL . '/uploads/member/avatars/',
    'avatar_max_height' => 100,
    'avatar_max_width' => 100,
    'avatar_max_kb' => 100,

    'enable_photos' => 'n',
    'photo_path' => NSM_DOC_ROOT . '/content/uploads/member/photos/',
    'photo_url' => NSM_SITE_URL . '/uploads/member/photos/',
    'photo_max_height' => 200,
    'photo_max_width' => 200,
    'photo_max_kb' => 200,

    'sig_allow_img_upload' => 'n',
    'sig_img_path' => NSM_DOC_ROOT . '/content/uploads/member/signature_attachments/',
    'sig_img_url' => NSM_SITE_URL . '/uploads/member/signature_attachments/',
    'sig_img_max_height' => 80,
    'sig_img_max_width' => 480,
    'sig_img_max_kb' => 30,
    'sig_maxlength' => 500,

    'captcha_font' => 'y',
    'captcha_rand' => 'y',
    'captcha_require_members' => 'n',
    'captcha_path' => NSM_DOC_ROOT . '/content/'.NSM_SYSTEM_FOLDER.'/images/captchas/',
    'captcha_url' => NSM_SITE_URL.'/'.NSM_SYSTEM_FOLDER.'/images/captchas/',

    // NSM htaccess Generator
    'nsm_htaccess_generator_path' => NSM_DOC_ROOT . "/content/.htaccess",

    );

    // Build the new config object
    $config = array_merge($config, $default_config, $env_config);

    /**
    * Custom global variables
    *
    * This is a bit sucky as they are pulled straight from the $assign_to_config array.
    * See EE_Config.php around line 90 or search for: 'global $assign_to_config;'
    * Output the global vars in your template with:
    * <?php $EE = get_instance(); print('<pre><code>'.print_r($EE->config->_global_vars, TRUE) . '</code></pre>'); ?>
    */
    $default_global_vars = array(
    // General
    'global:env' => NSM_ENV,

    // Tag parameters
    'global:param_disable_default' => 'disable="categories|pagination|data"',
    'global:param_disable_all' => 'disable="categories|custom_fields|data|pagination"',
    'global:param_cache_param' => 'cache="yes" refresh="10"',
    '-global:param_cache_param' => '-cache="yes" refresh="10"', // disable by adding a '-' to the front of the global

    // Date and time
    'global:date_time' => '%g:%i %a',
    'global:date_short' => '%F %d, %Y',
    'global:date_full' => '%F %d %Y, %g:%i %a',

    // Theme
    'global:theme_url' => '/themes/site_themes/default_site',
    );

    // Turn $_GET into global variables
    foreach ($_GET as $key => $value)
    if(!empty($value))
    $default_global_vars['get:' . $key] = $value;

    // Make this global so we can add some of the config variables here
    global $assign_to_config;

    if(!isset($assign_to_config['global_vars']))
    $assign_to_config['global_vars'] = array();

    $assign_to_config['global_vars'] = array_merge($assign_to_config['global_vars'], $default_global_vars, $env_global_vars);
    if(isset($config)) {

    /**
    * Custom global variables
    *
    * This is a bit sucky as they are pulled straight from the $assign_to_config array.
    * See EE_Config.php around line 90 or search for: 'global $assign_to_config;'
    * Output the global vars in your template with:
    * <?php $EE = get_instance(); print('<pre><code>'.print_r($EE->config->_global_vars, TRUE) . '</code></pre>'); ?>
    */
    $default_global_vars = array(
    // General - Set the production environment so we can test / show / hide components
    'global:env' => NSM_ENV,

    // Tag parameters - Short hand tag params
    'global:param_disable_default' => 'disable="categories|pagination|member_data"',
    'global:param_disable_all' => 'disable="categories|custom_fields|member_data|pagination"',
    'global:param_cache_param' => 'cache="yes" refresh="10"',
    '-global:param_cache_param' => '-cache="yes" refresh="10"', // disable by adding a '-' to the front of the global

    // Date and time - Short hand date and time
    'global:date_time' => '%g:%i %a',
    'global:date_short' => '%F %d, %Y',
    'global:date_full' => '%F %d %Y, %g:%i %a',

    /**
    * Theme - URL to theme assets
    * Example: <script src="{global:theme_url}/js/libs/modernizr-1.6.min.js"></script>
    */
    'global:theme_url' => NSM_SITE_URL . '/themes/site_themes/default',

    /**
    * CampaignMonitor - Slug for CM signup forms
    * Example: <form action="http://newism.createsend.com/t/y/s/{global:cm_subscriber_list_slug}/" method="post">...</form>
    */
    'global:cm_subscriber_list_slug' => false,

    /**
    * Google Analytics Key
    * Example:
    * <script type="text/javascript">
    * var _gaq = _gaq || [];
    * _gaq.push(['_setAccount', 'UA-{global:google_analytics_key}']);
    * _gaq.push(['_trackPageview']);
    * </script>
    */
    'global:google_analytics_key' => false,

    // NSM Gravatar
    'global:nsm_gravatar_default_avatar' => NSM_SITE_URL . '/uploads/member/avatars/default.png'
    );

    // Turn $_GET into global variables
    foreach ($_GET as $key => $value)
    $default_global_vars['get:' . $key] = $value;

    // Turn $_GET into global variables
    foreach ($_POST as $key => $value)
    if(!is_array($value))
    $default_global_vars['post:' . $key] = $value;

    // Make this global so we can add some of the config variables here
    global $assign_to_config;

    if(!isset($assign_to_config['global_vars']))
    $assign_to_config['global_vars'] = array();

    $assign_to_config['global_vars'] = array_merge($assign_to_config['global_vars'], $default_global_vars, $env_global_vars);

    /**
    * Config. This shouldn't have to be changed if you're using the Newism EE2 template.
    */
    $default_config = array(

    // General preferences
    'is_system_on' => 'y',
    'license_number' => '',
    'site_index' => '',
    'admin_session_type' => 'cs',
    'new_version_check' => 'y',
    'doc_url' => 'http://expressionengine.com/user_guide/',

    'site_url' => NSM_SITE_URL,
    'cp_url' => NSM_SITE_URL.'/'.NSM_SYSTEM_FOLDER.'/index.php',

    // Set this so we can use query strings
    'uri_protocol' => 'PATH_INFO',

    // Datbase preferences
    'db_debug' => 'n',
    'pconnect' => 'n',
    'enable_db_caching' => 'n',

    // Site preferences
    // Some of these preferences might actually need to be set in the index.php files.
    // Not sure which ones yet, I'll figure that out when I have my first MSM site.
    'is_site_on' => 'y',
    'site_404' => 'site/four04',

    'webmaster_email' => 'admin@' . NSM_SERVER_NAME,
    'webmaster_name' => 'Admin',

    // Localization preferences
    'server_timezone' => 'UP10',
    'server_offset' => FALSE,
    'time_format' => 'eu',
    'daylight_savings' => 'n',
    'honor_entry_dst' => 'y',

    // Channel preferences
    'use_category_name' => 'y',
    'word_separator' => 'dash',
    'reserved_category_word' => 'category',

    // Template preferences
    'strict_urls' => 'y',
    'save_tmpl_files' => 'y',
    'save_tmpl_revisions' => 'y',
    'tmpl_file_basepath' => NSM_BASEPATH . '/templates/',

    // Theme preferences
    'theme_folder_path' => NSM_BASEPATH . '/content/themes/',
    'theme_folder_url' => NSM_SITE_URL . '/themes/',

    // Tracking preferences
    'enable_online_user_tracking' => 'n',
    'dynamic_tracking_disabling' => '500',
    'enable_hit_tracking' => 'n',
    'enable_entry_view_tracking' => 'n',
    'log_referrers' => 'n',

    // Member preferences
    'allow_registration' => 'n',
    'profile_trigger' => '--sdjhkj2lffgrerfvmdkndkfisolmfmsd' . time(),

    'prv_msg_upload_path' => NSM_BASEPATH . '/content/uploads/member/pm_attachments',
    'enable_emoticons' => 'n',

    'enable_avatars' => 'n',
    'avatar_path' => NSM_BASEPATH . '/content/uploads/member/avatars/',
    'avatar_url' => NSM_SITE_URL . '/uploads/member/avatars/',
    'avatar_max_height' => 100,
    'avatar_max_width' => 100,
    'avatar_max_kb' => 100,

    'enable_photos' => 'n',
    'photo_path' => NSM_BASEPATH . '/content/uploads/member/photos/',
    'photo_url' => NSM_SITE_URL . '/uploads/member/photos/',
    'photo_max_height' => 200,
    'photo_max_width' => 200,
    'photo_max_kb' => 200,

    'sig_allow_img_upload' => 'n',
    'sig_img_path' => NSM_BASEPATH . '/content/uploads/member/signature_attachments/',
    'sig_img_url' => NSM_SITE_URL . '/uploads/member/signature_attachments/',
    'sig_img_max_height' => 80,
    'sig_img_max_width' => 480,
    'sig_img_max_kb' => 30,
    'sig_maxlength' => 500,

    'captcha_font' => 'y',
    'captcha_rand' => 'y',
    'captcha_require_members' => 'n',
    'captcha_path' => NSM_BASEPATH . '/content/'.NSM_SYSTEM_FOLDER.'/images/captchas/',
    'captcha_url' => NSM_SITE_URL.'/'.NSM_SYSTEM_FOLDER.'/images/captchas/',

    // NSM htaccess Generator
    'nsm_htaccess_generator_path' => NSM_BASEPATH . "/content/.htaccess",
    );



    // Build the new config object
    $config = array_merge($config, $default_config, $env_config);
    }

    // DB bootsrap... GO!
    if(isset($db['expressionengine']))
    {
    $default_db_config = array("cachedir" => APPPATH . "cache/db_cache/");
    $db['expressionengine'] = array_merge($db['expressionengine'], $default_db_config, $env_db_config);
    $default_db_config = array("cachedir" => APPPATH . "cache/db_cache/");
    $db['expressionengine'] = array_merge($db['expressionengine'], $default_db_config, $env_db_config);
    }
  7. @leevigraham leevigraham revised this gist Oct 15, 2010. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion config_bootstrap.php
    Original file line number Diff line number Diff line change
    @@ -33,7 +33,6 @@
    if ( strstr( NSM_SERVER_NAME, 'local.' ) ) define('NSM_ENV', 'local');
    elseif( strstr( NSM_SERVER_NAME, 'dev.' ) ) define('NSM_ENV', 'dev');
    elseif( strstr( NSM_SERVER_NAME, 'stage.' ) ) define('NSM_ENV', 'stage');
    // MOBILE SITE
    elseif( strstr( NSM_SERVER_NAME, 'mobile.' ) ) define('NSM_ENV', 'mobile');
    else define('NSM_ENV', 'production');
    }
  8. @leevigraham leevigraham revised this gist Oct 15, 2010. 1 changed file with 19 additions and 1 deletion.
    20 changes: 19 additions & 1 deletion config_bootstrap.php
    Original file line number Diff line number Diff line change
    @@ -33,6 +33,8 @@
    if ( strstr( NSM_SERVER_NAME, 'local.' ) ) define('NSM_ENV', 'local');
    elseif( strstr( NSM_SERVER_NAME, 'dev.' ) ) define('NSM_ENV', 'dev');
    elseif( strstr( NSM_SERVER_NAME, 'stage.' ) ) define('NSM_ENV', 'stage');
    // MOBILE SITE
    elseif( strstr( NSM_SERVER_NAME, 'mobile.' ) ) define('NSM_ENV', 'mobile');
    else define('NSM_ENV', 'production');
    }

    @@ -42,7 +44,9 @@
    $env_db_config = array();
    $env_global_vars = array();

    // Set the environmental config and global vars
    /* Set the environmental config and global vars */

    // Local
    if (NSM_ENV == 'local'){
    $env_db_config = array(
    'hostname' => 'localhost',
    @@ -52,8 +56,22 @@
    );
    // $env_global_vars = array();
    }

    // Development
    elseif(NSM_ENV == 'dev'){}

    // Staging
    elseif(NSM_ENV == 'stage'){}

    // Mobile site example
    elseif(NSM_ENV == 'mobile'){
    // If the environment is mobile we'll load a different template path
    // * Files must be saved as templates
    // * Template Groups / Templates must be the same
    $env_config['tmpl_file_basepath'] = NSM_DOC_ROOT . '/templates_mobile/';
    }

    // Live site
    else{}

    // Config bootsrap... GO!
  9. @leevigraham leevigraham revised this gist Oct 7, 2010. 1 changed file with 10 additions and 11 deletions.
    21 changes: 10 additions & 11 deletions config_bootstrap.php
    Original file line number Diff line number Diff line change
    @@ -86,7 +86,6 @@
    // Not sure which ones yet, I'll figure that out when I have my first MSM site.
    'is_site_on' => 'y',
    'site_name' => 'EE Template',
    'site_label' => 'EE Template',
    'site_short_name' => 'default_site',
    'site_description' => '',
    'site_404' => 'site/four04',
    @@ -175,27 +174,27 @@
    */
    $default_global_vars = array(
    // General
    'gv_env' => NSM_ENV,
    'global:env' => NSM_ENV,

    // Tag parameters
    'gv_param_disable_default' => 'disable="categories|pagination|data"',
    'gv_param_disable_all' => 'disable="categories|custom_fields|data|pagination"',
    'gv_param_cache_param' => 'cache="yes" refresh="10"',
    '-gv_param_cache_param' => '-cache="yes" refresh="10"', // disable by adding a '-' to the front of the global
    'global:param_disable_default' => 'disable="categories|pagination|data"',
    'global:param_disable_all' => 'disable="categories|custom_fields|data|pagination"',
    'global:param_cache_param' => 'cache="yes" refresh="10"',
    '-global:param_cache_param' => '-cache="yes" refresh="10"', // disable by adding a '-' to the front of the global

    // Date and time
    'gv_date_time' => '%g:%i %a',
    'gv_date_short' => '%F %d, %Y',
    'gv_date_full' => '%F %d %Y, %g:%i %a',
    'global:date_time' => '%g:%i %a',
    'global:date_short' => '%F %d, %Y',
    'global:date_full' => '%F %d %Y, %g:%i %a',

    // Theme
    'gv_theme_url' => '/themes/site_themes/default_site',
    'global:theme_url' => '/themes/site_themes/default_site',
    );

    // Turn $_GET into global variables
    foreach ($_GET as $key => $value)
    if(!empty($value))
    $default_global_vars['gv_get_' . $key] = $value;
    $default_global_vars['get:' . $key] = $value;

    // Make this global so we can add some of the config variables here
    global $assign_to_config;
  10. @leevigraham leevigraham revised this gist Aug 2, 2010. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions config_bootstrap.php
    Original file line number Diff line number Diff line change
    @@ -102,7 +102,7 @@
    'honor_entry_dst' => 'y',

    // Channel preferences
    'word_separator' => '-',
    'word_separator' => 'dash',
    'reserved_category_word' => 'cat',

    // Template preferences
    @@ -178,7 +178,7 @@
    'gv_env' => NSM_ENV,

    // Tag parameters
    'gv_param_disable_default' => 'disable="categories|pagination|data"',
    'gv_param_disable_default' => 'disable="categories|pagination|data"',
    'gv_param_disable_all' => 'disable="categories|custom_fields|data|pagination"',
    'gv_param_cache_param' => 'cache="yes" refresh="10"',
    '-gv_param_cache_param' => '-cache="yes" refresh="10"', // disable by adding a '-' to the front of the global
    @@ -192,6 +192,7 @@
    'gv_theme_url' => '/themes/site_themes/default_site',
    );

    // Turn $_GET into global variables
    foreach ($_GET as $key => $value)
    if(!empty($value))
    $default_global_vars['gv_get_' . $key] = $value;
  11. @leevigraham leevigraham revised this gist Jul 14, 2010. 1 changed file with 163 additions and 163 deletions.
    326 changes: 163 additions & 163 deletions config_bootstrap.php
    Original file line number Diff line number Diff line change
    @@ -24,16 +24,16 @@
    // Setup the environment
    if(!defined('NSM_ENV'))
    {
    define('NSM_SERVER_NAME', $_SERVER['SERVER_NAME']);
    define('NSM_SITE_URL', 'http://'.NSM_SERVER_NAME);
    define('NSM_DOC_ROOT', dirname(__FILE__));
    define('NSM_SYSTEM_FOLDER', 'ee-admin');

    // Set the environment
    if ( strstr( NSM_SERVER_NAME, 'local.' ) ) define('NSM_ENV', 'local');
    elseif( strstr( NSM_SERVER_NAME, 'dev.' ) ) define('NSM_ENV', 'dev');
    elseif( strstr( NSM_SERVER_NAME, 'stage.' ) ) define('NSM_ENV', 'stage');
    else define('NSM_ENV', 'production');
    define('NSM_SERVER_NAME', $_SERVER['SERVER_NAME']);
    define('NSM_SITE_URL', 'http://'.NSM_SERVER_NAME);
    define('NSM_DOC_ROOT', dirname(__FILE__));
    define('NSM_SYSTEM_FOLDER', 'ee-admin');

    // Set the environment
    if ( strstr( NSM_SERVER_NAME, 'local.' ) ) define('NSM_ENV', 'local');
    elseif( strstr( NSM_SERVER_NAME, 'dev.' ) ) define('NSM_ENV', 'dev');
    elseif( strstr( NSM_SERVER_NAME, 'stage.' ) ) define('NSM_ENV', 'stage');
    else define('NSM_ENV', 'production');
    }

    // Define the environment settings
    @@ -44,13 +44,13 @@

    // Set the environmental config and global vars
    if (NSM_ENV == 'local'){
    $env_db_config = array(
    'hostname' => 'localhost',
    'username' => 'root',
    'password' => '',
    'database' => 'your_db',
    );
    // $env_global_vars = array();
    $env_db_config = array(
    'hostname' => 'localhost',
    'username' => 'root',
    'password' => '',
    'database' => 'your_db',
    );
    // $env_global_vars = array();
    }
    elseif(NSM_ENV == 'dev'){}
    elseif(NSM_ENV == 'stage'){}
    @@ -59,155 +59,155 @@
    // Config bootsrap... GO!
    if(isset($config))
    {
    // Our default config. This shouldn't have to be changed if you're using the Newism EE2 template.
    $default_config = array(

    // Gneral preferences
    'is_system_on' => 'y',
    'license_number' => '',
    'index_page' => '',
    'admin_session_type' => 'cs',
    'new_version_check' => 'y',
    'doc_url' => 'http://expressionengine.com/user_guide/',

    'site_url' => NSM_SITE_URL,
    'cp_url' => NSM_SITE_URL.'/'.NSM_SYSTEM_FOLDER.'/index.php',

    // Set this so we can use query strings
    'uri_protocol' => 'PATH_INFO',

    // Datbase preferences
    'db_debug' => 'n',
    'pconnect' => 'n',
    'enable_db_caching' => 'n',

    // Site preferences
    // Some of these preferences might actually need to be set in the index.php files.
    // Not sure which ones yet, I'll figure that out when I have my first MSM site.
    'is_site_on' => 'y',
    'site_name' => 'EE Template',
    'site_label' => 'EE Template',
    'site_short_name' => 'default_site',
    'site_description' => '',
    'site_404' => 'site/four04',

    //'webmaster_email' => 'admin@' . NSM_SERVER_NAME,
    //'webmaster_name' => 'Admin',

    // Localization preferences
    'server_timezone' => 'UP10',
    'server_offset' => FALSE,
    'time_format' => 'eu',
    'daylight_savings' => 'n',
    'honor_entry_dst' => 'y',

    // Channel preferences
    'word_separator' => '-',
    'reserved_category_word' => 'cat',

    // Template preferences
    'strict_urls' => 'y',
    'save_tmpl_files' => 'y',
    'save_tmpl_revisions' => 'y',
    'tmpl_file_basepath' => NSM_DOC_ROOT . '/templates/',

    // Theme preferences
    'theme_folder_path' => NSM_DOC_ROOT . '/content/themes/',
    'theme_folder_url' => NSM_SITE_URL . '/themes/',

    // Tracking preferences
    'enable_online_user_tracking' => 'n',
    'dynamic_tracking_disabling' => '500',
    'enable_hit_tracking' => 'n',
    'enable_entry_view_tracking' => 'n',
    'log_referrers' => 'n',

    // Member preferences
    'allow_registration' => 'n',
    'profile_trigger' => '--sdjhkj2lffgrerfvmdkndkfisolmfmsd',

    'prv_msg_upload_path' => NSM_DOC_ROOT . '/content/uploads/member/prv_messages',
    'enable_emoticons' => 'n',

    'enable_avatars' => 'n',
    'avatar_path' => NSM_DOC_ROOT . '/content/uploads/member/avatars/',
    'avatar_url' => NSM_SITE_URL . '/uploads/member/avatars/',
    'avatar_max_height' => 100,
    'avatar_max_width' => 100,
    'avatar_max_kb' => 100,

    'enable_photos' => 'n',
    'photo_path' => NSM_DOC_ROOT . '/content/uploads/member/photos/',
    'photo_url' => NSM_SITE_URL . '/uploads/member/photos/',
    'photo_max_height' => 200,
    'photo_max_width' => 200,
    'photo_max_kb' => 200,

    'sig_allow_img_upload' => 'n',
    'sig_img_path' => NSM_DOC_ROOT . '/content/uploads/member/signature_attachments/',
    'sig_img_url' => NSM_SITE_URL . '/uploads/member/signature_attachments/',
    'sig_img_max_height' => 80,
    'sig_img_max_width' => 480,
    'sig_img_max_kb' => 30,
    'sig_maxlength' => 500,

    'captcha_font' => 'y',
    'captcha_rand' => 'y',
    'captcha_require_members' => 'n',
    'captcha_path' => NSM_DOC_ROOT . '/content/'.NSM_SYSTEM_FOLDER.'/images/captchas/',
    'captcha_url' => NSM_SITE_URL.'/'.NSM_SYSTEM_FOLDER.'/images/captchas/',

    // NSM htaccess Generator
    'nsm_htaccess_generator_path' => NSM_DOC_ROOT . "/content/.htaccess",
    );

    // Build the new config object
    $config = array_merge($config, $default_config, $env_config);

    /**
    * Custom global variables
    *
    * This is a bit sucky as they are pulled straight from the $assign_to_config array.
    * See EE_Config.php around line 90 or search for: 'global $assign_to_config;'
    * Output the global vars in your template with:
    * <?php $EE = get_instance(); print('<pre><code>'.print_r($EE->config->_global_vars, TRUE) . '</code></pre>'); ?>
    */
    $default_global_vars = array(
    // General
    'gv_env' => NSM_ENV,

    // Tag parameters
    'gv_param_disable_default' => 'disable="categories|pagination|data"',
    'gv_param_disable_all' => 'disable="categories|custom_fields|data|pagination"',
    'gv_param_cache_param' => 'cache="yes" refresh="10"',
    '-gv_param_cache_param' => '-cache="yes" refresh="10"', // disable by adding a '-' to the front of the global

    // Date and time
    'gv_date_time' => '%g:%i %a',
    'gv_date_short' => '%F %d, %Y',
    'gv_date_full' => '%F %d %Y, %g:%i %a',

    // Theme
    'gv_theme_url' => '/themes/site_themes/default_site',
    );

    foreach ($_GET as $key => $value)
    if(!empty($value))
    $default_global_vars['gv_get_' . $key] = $value;

    // Make this global so we can add some of the config variables here
    global $assign_to_config;

    if(!isset($assign_to_config['global_vars']))
    $assign_to_config['global_vars'] = array();

    $assign_to_config['global_vars'] = array_merge($assign_to_config['global_vars'], $default_global_vars, $env_global_vars);
    // Our default config. This shouldn't have to be changed if you're using the Newism EE2 template.
    $default_config = array(

    // General preferences
    'is_system_on' => 'y',
    'license_number' => '',
    'site_index' => '',
    'admin_session_type' => 'cs',
    'new_version_check' => 'y',
    'doc_url' => 'http://expressionengine.com/user_guide/',

    'site_url' => NSM_SITE_URL,
    'cp_url' => NSM_SITE_URL.'/'.NSM_SYSTEM_FOLDER.'/index.php',

    // Set this so we can use query strings
    'uri_protocol' => 'PATH_INFO',

    // Datbase preferences
    'db_debug' => 'n',
    'pconnect' => 'n',
    'enable_db_caching' => 'n',

    // Site preferences
    // Some of these preferences might actually need to be set in the index.php files.
    // Not sure which ones yet, I'll figure that out when I have my first MSM site.
    'is_site_on' => 'y',
    'site_name' => 'EE Template',
    'site_label' => 'EE Template',
    'site_short_name' => 'default_site',
    'site_description' => '',
    'site_404' => 'site/four04',

    //'webmaster_email' => 'admin@' . NSM_SERVER_NAME,
    //'webmaster_name' => 'Admin',

    // Localization preferences
    'server_timezone' => 'UP10',
    'server_offset' => FALSE,
    'time_format' => 'eu',
    'daylight_savings' => 'n',
    'honor_entry_dst' => 'y',

    // Channel preferences
    'word_separator' => '-',
    'reserved_category_word' => 'cat',

    // Template preferences
    'strict_urls' => 'y',
    'save_tmpl_files' => 'y',
    'save_tmpl_revisions' => 'y',
    'tmpl_file_basepath' => NSM_DOC_ROOT . '/templates/',

    // Theme preferences
    'theme_folder_path' => NSM_DOC_ROOT . '/content/themes/',
    'theme_folder_url' => NSM_SITE_URL . '/themes/',

    // Tracking preferences
    'enable_online_user_tracking' => 'n',
    'dynamic_tracking_disabling' => '500',
    'enable_hit_tracking' => 'n',
    'enable_entry_view_tracking' => 'n',
    'log_referrers' => 'n',

    // Member preferences
    'allow_registration' => 'n',
    'profile_trigger' => '--sdjhkj2lffgrerfvmdkndkfisolmfmsd',

    'prv_msg_upload_path' => NSM_DOC_ROOT . '/content/uploads/member/prv_messages',
    'enable_emoticons' => 'n',

    'enable_avatars' => 'n',
    'avatar_path' => NSM_DOC_ROOT . '/content/uploads/member/avatars/',
    'avatar_url' => NSM_SITE_URL . '/uploads/member/avatars/',
    'avatar_max_height' => 100,
    'avatar_max_width' => 100,
    'avatar_max_kb' => 100,

    'enable_photos' => 'n',
    'photo_path' => NSM_DOC_ROOT . '/content/uploads/member/photos/',
    'photo_url' => NSM_SITE_URL . '/uploads/member/photos/',
    'photo_max_height' => 200,
    'photo_max_width' => 200,
    'photo_max_kb' => 200,

    'sig_allow_img_upload' => 'n',
    'sig_img_path' => NSM_DOC_ROOT . '/content/uploads/member/signature_attachments/',
    'sig_img_url' => NSM_SITE_URL . '/uploads/member/signature_attachments/',
    'sig_img_max_height' => 80,
    'sig_img_max_width' => 480,
    'sig_img_max_kb' => 30,
    'sig_maxlength' => 500,

    'captcha_font' => 'y',
    'captcha_rand' => 'y',
    'captcha_require_members' => 'n',
    'captcha_path' => NSM_DOC_ROOT . '/content/'.NSM_SYSTEM_FOLDER.'/images/captchas/',
    'captcha_url' => NSM_SITE_URL.'/'.NSM_SYSTEM_FOLDER.'/images/captchas/',

    // NSM htaccess Generator
    'nsm_htaccess_generator_path' => NSM_DOC_ROOT . "/content/.htaccess",

    );

    // Build the new config object
    $config = array_merge($config, $default_config, $env_config);

    /**
    * Custom global variables
    *
    * This is a bit sucky as they are pulled straight from the $assign_to_config array.
    * See EE_Config.php around line 90 or search for: 'global $assign_to_config;'
    * Output the global vars in your template with:
    * <?php $EE = get_instance(); print('<pre><code>'.print_r($EE->config->_global_vars, TRUE) . '</code></pre>'); ?>
    */
    $default_global_vars = array(
    // General
    'gv_env' => NSM_ENV,

    // Tag parameters
    'gv_param_disable_default' => 'disable="categories|pagination|data"',
    'gv_param_disable_all' => 'disable="categories|custom_fields|data|pagination"',
    'gv_param_cache_param' => 'cache="yes" refresh="10"',
    '-gv_param_cache_param' => '-cache="yes" refresh="10"', // disable by adding a '-' to the front of the global

    // Date and time
    'gv_date_time' => '%g:%i %a',
    'gv_date_short' => '%F %d, %Y',
    'gv_date_full' => '%F %d %Y, %g:%i %a',

    // Theme
    'gv_theme_url' => '/themes/site_themes/default_site',
    );

    foreach ($_GET as $key => $value)
    if(!empty($value))
    $default_global_vars['gv_get_' . $key] = $value;

    // Make this global so we can add some of the config variables here
    global $assign_to_config;

    if(!isset($assign_to_config['global_vars']))
    $assign_to_config['global_vars'] = array();

    $assign_to_config['global_vars'] = array_merge($assign_to_config['global_vars'], $default_global_vars, $env_global_vars);
    }

    // DB bootsrap... GO!
    if(isset($db['expressionengine']))
    {
    $default_db_config = array("cachedir" => APPPATH . "cache/db_cache/");
    $db['expressionengine'] = array_merge($db['expressionengine'], $default_db_config, $env_db_config);
    $default_db_config = array("cachedir" => APPPATH . "cache/db_cache/");
    $db['expressionengine'] = array_merge($db['expressionengine'], $default_db_config, $env_db_config);
    }
  12. @leevigraham leevigraham revised this gist Jul 14, 2010. 1 changed file with 176 additions and 174 deletions.
    350 changes: 176 additions & 174 deletions config_bootstrap.php
    Original file line number Diff line number Diff line change
    @@ -1,38 +1,39 @@
    <?php
    /**
    * Custom configuration file for ExpressionEngine
    * Custom configuration bootsrtap file for ExpressionEngine
    *
    * Place config_bootstrap.php in your site root
    * Add: require(realpath(dirname(__FILE__) . '/../../config_bootstrap.php')); to the bottom of system/expressionengine/config/config.php
    * Add require(realpath(dirname(__FILE__) . '/../../config_bootstrap.php')); to the bottom of system/expressionengine/config/database.php
    * Place config.php in your site root
    * Add require(realpath(dirname(__FILE__) . '/../../config.php')); to the bottom of system/expressionengine/config/config.php
    * Add require(realpath(dirname(__FILE__) . '/../../config.php')); to the bottom of system/expressionengine/config/database.php
    * If you have moved your site root you'll need to update the require_once path
    *
    * Note: If you have moved your site root you'll need to update the require_once path
    * Also includes custom DB configuration file based on your environment
    *
    * Asset paths such as member avatars reflect Newism's folder approach not the default EE install
    * Posiible DB configuration options
    *
    * Also includes custom DB configuration file based on your environment. Possible configuration options:
    *
    * $env_db_config['hostname'] = "localhost";
    * $env_db_config['username'] = "root";
    * $env_db_config['hostname'] = "";
    * $env_db_config['username'] = "";
    * $env_db_config['password'] = "";
    * $env_db_config['database'] = "your_database";
    * $env_db_config['database'] = "";
    *
    * @author Leevi Graham <http://leevigraham.com>, Technical Director - Newism <http://newism.com.au>
    * @link http://expressionengine.com/wiki/EE_2_Config_Overrides/
    * @author Leevi Graham <http://leevigraham.com>
    * @link http://expressionengine.com/index.php?affiliate=leevigraham&page=wiki/EE_2_Config_Overrides/
    * @link http://eeinsider.com/blog/eeci-2010-how-erskine-rolls-with-ee/ - Hat tip to: Erskine from EECI2010 Preso
    */

    // Setup the environment
    if(!defined('NSM_ENV'))
    {
    define('NSM_SERVER_NAME', $_SERVER['SERVER_NAME']);
    define('NSM_SITE_URL', 'http://'.NSM_SERVER_NAME);
    define('NSM_DOC_ROOT', realpath(dirname(__FILE__)));

    // Set the environment
    if ( strstr( NSM_SERVER_NAME, 'local.' ) ) define('NSM_ENV', 'local');
    elseif( strstr( NSM_SERVER_NAME, 'dev.' ) ) define('NSM_ENV', 'dev');
    elseif( strstr( NSM_SERVER_NAME, 'stage.' ) ) define('NSM_ENV', 'stage');
    else define('NSM_ENV', 'production');
    define('NSM_SERVER_NAME', $_SERVER['SERVER_NAME']);
    define('NSM_SITE_URL', 'http://'.NSM_SERVER_NAME);
    define('NSM_DOC_ROOT', dirname(__FILE__));
    define('NSM_SYSTEM_FOLDER', 'ee-admin');

    // Set the environment
    if ( strstr( NSM_SERVER_NAME, 'local.' ) ) define('NSM_ENV', 'local');
    elseif( strstr( NSM_SERVER_NAME, 'dev.' ) ) define('NSM_ENV', 'dev');
    elseif( strstr( NSM_SERVER_NAME, 'stage.' ) ) define('NSM_ENV', 'stage');
    else define('NSM_ENV', 'production');
    }

    // Define the environment settings
    @@ -43,14 +44,13 @@

    // Set the environmental config and global vars
    if (NSM_ENV == 'local'){
    // $env_config = array();
    $env_db_config = array(
    'hostname' => 'localhost',
    'username' => 'root',
    'password' => '',
    'database' => 'your_database'
    );
    // $env_global_vars = array();
    $env_db_config = array(
    'hostname' => 'localhost',
    'username' => 'root',
    'password' => '',
    'database' => 'your_db',
    );
    // $env_global_vars = array();
    }
    elseif(NSM_ENV == 'dev'){}
    elseif(NSM_ENV == 'stage'){}
    @@ -59,153 +59,155 @@
    // Config bootsrap... GO!
    if(isset($config))
    {
    // Our default config. This shouldn't have to be changed if you're using the Newism EE2 template.
    $default_config = array(

    // Gneral preferences
    'is_system_on' => 'y',
    'license_number' => '',
    'index_page' => '',
    'admin_session_type' => 'cs',
    'new_version_check' => 'y',
    'doc_url' => 'http://expressionengine.com/public_beta/docs/',

    'base_url' => NSM_SITE_URL,
    'cp_url' => NSM_SITE_URL . '/ee-admin/index.php',

    // Set this so we can use query strings
    // Our .htaccess rule must look like: RewriteRule (.*) /index.php/$1 [L]
    'uri_protocol' => 'PATH_INFO',

    // Site preferences
    // Some of these preferences might actually need to be set in the index.php files.
    // Not sure which ones yet, I'll figure that out when I have my first MSM site.
    'is_site_on' => 'y',
    'site_name' => 'EE Template',
    'site_label' => 'EE Template',
    'site_short_name' => 'default_site',
    'site_description' => '',
    'site_404' => 'site/four04',

    'webmaster_email' => 'admin@' . NSM_SERVER_NAME,
    'webmaster_name' => 'Admin',

    // Localization preferences
    'server_timezone' => 'UP10',
    'server_offset' => FALSE,
    'time_format' => 'eu',
    'daylight_savings' => 'n',
    'honor_entry_dst' => 'y',

    // Channel preferences
    'word_separator' => '-',
    'reserved_category_word' => 'cat',

    // Template preferences
    'strict_urls' => 'y',
    'save_tmpl_files' => 'y',
    'save_tmpl_revisions' => 'y',
    'tmpl_file_basepath' => NSM_DOC_ROOT . '/templates/',

    // Theme preferences
    'theme_folder_path' => NSM_DOC_ROOT . '/content/themes/',
    'theme_folder_url' => NSM_SITE_URL . '/themes/',

    // Tracking preferences
    'enable_online_user_tracking' => 'n',
    'dynamic_tracking_disabling' => '500',
    'enable_hit_tracking' => 'n',
    'enable_entry_view_tracking' => 'n',
    'log_referrers' => 'n',

    // Member preferences
    'allow_member_registration' => 'n',
    'profile_trigger' => '--sdsdjh22kj3hjksdkjhkj2lffgrerfvmdkndkfisolmfmsd',

    'enable_avatars' => 'n',
    'avatar_path' => NSM_DOC_ROOT . '/content/uploads/member_assets/member_avatars/',
    'avatar_url' => NSM_SITE_URL . '/member_assets/member_avatars/',
    'avatar_max_height' => 100,
    'avatar_max_width' => 100,
    'avatar_max_kb' => 100,

    'enable_photos' => 'n',
    'photo_path' => NSM_DOC_ROOT . '/content/uploads/member_assets/member_photos/',
    'photo__url' => NSM_SITE_URL . '/member_assets/member_photos/',
    'photo_max_height' => 200,
    'photo_max_width' => 200,
    'photo_max_kb' => 200,

    'enable_emoticons' => 'n',

    'sig_allow_img_upload' => 'n',
    'sig_img_path' => NSM_DOC_ROOT . '/content/uploads/member_assets/signature_attachments/',
    'sig_img_url' => NSM_SITE_URL . '/member_assets/signature_attachments/',
    'sig_img_max_height' => 80,
    'sig_img_max_width' => 480,
    'sig_img_max_kb' => 30,
    'sig_maxlength' => 500,

    // Capcha preferences
    'captcha_font' => 'y',
    'captcha_rand' => 'y',
    'captcha_require_members' => 'n',
    'captcha_path' => NSM_DOC_ROOT . '/content/images/captchas/',
    'captcha_url' => NSM_SITE_URL . '/images/captchas/',
    );

    // Build the new config object
    $config = array_merge($config, $default_config, $env_config);

    /**
    * Custom global variables
    *
    * This is a bit sucky as they are pulled straight from the $assign_to_config array.
    * See EE_Config.php around line 90 or search for: 'global $assign_to_config;'
    * Output the global vars in your template with:
    * <?php $EE = get_instance(); print('<pre><code>'.print_r($EE->config->_global_vars, TRUE) . '</code></pre>'); ?>
    * Hat tip to: Erskine from EECI2010 Preso: http://eeinsider.com/blog/eeci-2010-how-erskine-rolls-with-ee/
    */

    $default_global_vars = array(
    // General
    'gv_env' => NSM_ENV,

    // Tag parameters
    'gv_param_disable_default' => 'disable="categories|pagination|member_data"',
    'gv_param_disable_all' => 'disable="categories|custom_fields|member_data|pagination"',
    'gv_param_cache_param' => 'cache="yes" refresh="10"',
    '-gv_param_cache_param' => '-cache="yes" refresh="10"', // disable by adding a '-' to the front of the global

    // Date and time
    'gv_date_time' => '%g:%i %a',
    'gv_date_short' => '%F %d, %Y',
    'gv_date_full' => '%F %d %Y, %g:%i %a',

    // theme urls
    'gv_theme_url' => '/themes/site_themes/default_site/'
    );

    // Make this global so we can add some of the config variables here
    global $assign_to_config;

    if(!isset($assign_to_config['global_vars']))
    $assign_to_config['global_vars'] = array();

    $assign_to_config['global_vars'] = array_merge(
    $assign_to_config['global_vars'],
    $default_global_vars,
    $env_global_vars
    );
    // Our default config. This shouldn't have to be changed if you're using the Newism EE2 template.
    $default_config = array(

    // Gneral preferences
    'is_system_on' => 'y',
    'license_number' => '',
    'index_page' => '',
    'admin_session_type' => 'cs',
    'new_version_check' => 'y',
    'doc_url' => 'http://expressionengine.com/user_guide/',

    'site_url' => NSM_SITE_URL,
    'cp_url' => NSM_SITE_URL.'/'.NSM_SYSTEM_FOLDER.'/index.php',

    // Set this so we can use query strings
    'uri_protocol' => 'PATH_INFO',

    // Datbase preferences
    'db_debug' => 'n',
    'pconnect' => 'n',
    'enable_db_caching' => 'n',

    // Site preferences
    // Some of these preferences might actually need to be set in the index.php files.
    // Not sure which ones yet, I'll figure that out when I have my first MSM site.
    'is_site_on' => 'y',
    'site_name' => 'EE Template',
    'site_label' => 'EE Template',
    'site_short_name' => 'default_site',
    'site_description' => '',
    'site_404' => 'site/four04',

    //'webmaster_email' => 'admin@' . NSM_SERVER_NAME,
    //'webmaster_name' => 'Admin',

    // Localization preferences
    'server_timezone' => 'UP10',
    'server_offset' => FALSE,
    'time_format' => 'eu',
    'daylight_savings' => 'n',
    'honor_entry_dst' => 'y',

    // Channel preferences
    'word_separator' => '-',
    'reserved_category_word' => 'cat',

    // Template preferences
    'strict_urls' => 'y',
    'save_tmpl_files' => 'y',
    'save_tmpl_revisions' => 'y',
    'tmpl_file_basepath' => NSM_DOC_ROOT . '/templates/',

    // Theme preferences
    'theme_folder_path' => NSM_DOC_ROOT . '/content/themes/',
    'theme_folder_url' => NSM_SITE_URL . '/themes/',

    // Tracking preferences
    'enable_online_user_tracking' => 'n',
    'dynamic_tracking_disabling' => '500',
    'enable_hit_tracking' => 'n',
    'enable_entry_view_tracking' => 'n',
    'log_referrers' => 'n',

    // Member preferences
    'allow_registration' => 'n',
    'profile_trigger' => '--sdjhkj2lffgrerfvmdkndkfisolmfmsd',

    'prv_msg_upload_path' => NSM_DOC_ROOT . '/content/uploads/member/prv_messages',
    'enable_emoticons' => 'n',

    'enable_avatars' => 'n',
    'avatar_path' => NSM_DOC_ROOT . '/content/uploads/member/avatars/',
    'avatar_url' => NSM_SITE_URL . '/uploads/member/avatars/',
    'avatar_max_height' => 100,
    'avatar_max_width' => 100,
    'avatar_max_kb' => 100,

    'enable_photos' => 'n',
    'photo_path' => NSM_DOC_ROOT . '/content/uploads/member/photos/',
    'photo_url' => NSM_SITE_URL . '/uploads/member/photos/',
    'photo_max_height' => 200,
    'photo_max_width' => 200,
    'photo_max_kb' => 200,

    'sig_allow_img_upload' => 'n',
    'sig_img_path' => NSM_DOC_ROOT . '/content/uploads/member/signature_attachments/',
    'sig_img_url' => NSM_SITE_URL . '/uploads/member/signature_attachments/',
    'sig_img_max_height' => 80,
    'sig_img_max_width' => 480,
    'sig_img_max_kb' => 30,
    'sig_maxlength' => 500,

    'captcha_font' => 'y',
    'captcha_rand' => 'y',
    'captcha_require_members' => 'n',
    'captcha_path' => NSM_DOC_ROOT . '/content/'.NSM_SYSTEM_FOLDER.'/images/captchas/',
    'captcha_url' => NSM_SITE_URL.'/'.NSM_SYSTEM_FOLDER.'/images/captchas/',

    // NSM htaccess Generator
    'nsm_htaccess_generator_path' => NSM_DOC_ROOT . "/content/.htaccess",

    );

    // Build the new config object
    $config = array_merge($config, $default_config, $env_config);

    /**
    * Custom global variables
    *
    * This is a bit sucky as they are pulled straight from the $assign_to_config array.
    * See EE_Config.php around line 90 or search for: 'global $assign_to_config;'
    * Output the global vars in your template with:
    * <?php $EE = get_instance(); print('<pre><code>'.print_r($EE->config->_global_vars, TRUE) . '</code></pre>'); ?>
    */
    $default_global_vars = array(
    // General
    'gv_env' => NSM_ENV,

    // Tag parameters
    'gv_param_disable_default' => 'disable="categories|pagination|data"',
    'gv_param_disable_all' => 'disable="categories|custom_fields|data|pagination"',
    'gv_param_cache_param' => 'cache="yes" refresh="10"',
    '-gv_param_cache_param' => '-cache="yes" refresh="10"', // disable by adding a '-' to the front of the global

    // Date and time
    'gv_date_time' => '%g:%i %a',
    'gv_date_short' => '%F %d, %Y',
    'gv_date_full' => '%F %d %Y, %g:%i %a',

    // Theme
    'gv_theme_url' => '/themes/site_themes/default_site',
    );

    foreach ($_GET as $key => $value)
    if(!empty($value))
    $default_global_vars['gv_get_' . $key] = $value;

    // Make this global so we can add some of the config variables here
    global $assign_to_config;

    if(!isset($assign_to_config['global_vars']))
    $assign_to_config['global_vars'] = array();

    $assign_to_config['global_vars'] = array_merge($assign_to_config['global_vars'], $default_global_vars, $env_global_vars);
    }

    // DB bootsrap... GO!
    if(isset($db['expressionengine']))
    {
    $default_db_config = array("cachedir" => APPPATH . "cache/db_cache/");
    $db['expressionengine'] = array_merge(
    $db['expressionengine'],
    $default_db_config,
    $env_db_config
    );
    $default_db_config = array("cachedir" => APPPATH . "cache/db_cache/");
    $db['expressionengine'] = array_merge($db['expressionengine'], $default_db_config, $env_db_config);
    }
  13. @leevigraham leevigraham revised this gist Jul 6, 2010. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions config_bootstrap.php
    Original file line number Diff line number Diff line change
    @@ -73,6 +73,10 @@
    'base_url' => NSM_SITE_URL,
    'cp_url' => NSM_SITE_URL . '/ee-admin/index.php',

    // Set this so we can use query strings
    // Our .htaccess rule must look like: RewriteRule (.*) /index.php/$1 [L]
    'uri_protocol' => 'PATH_INFO',

    // Site preferences
    // Some of these preferences might actually need to be set in the index.php files.
    // Not sure which ones yet, I'll figure that out when I have my first MSM site.
  14. @leevigraham leevigraham revised this gist Jul 2, 2010. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion config_bootstrap.php
    Original file line number Diff line number Diff line change
    @@ -45,7 +45,7 @@
    if (NSM_ENV == 'local'){
    // $env_config = array();
    $env_db_config = array(
    'host_name' => 'localhost',
    'hostname' => 'localhost',
    'username' => 'root',
    'password' => '',
    'database' => 'your_database'
  15. @leevigraham leevigraham renamed this gist Jun 29, 2010. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions config.php → config_bootstrap.php
    Original file line number Diff line number Diff line change
    @@ -2,9 +2,9 @@
    /**
    * Custom configuration file for ExpressionEngine
    *
    * Place config.php in your site root
    * Add: require(realpath(dirname(__FILE__) . '/../../config.php')); to the bottom of system/expressionengine/config/config.php
    * Add require(realpath(dirname(__FILE__) . '/../../config.php')); to the bottom of system/expressionengine/config/database.php
    * Place config_bootstrap.php in your site root
    * Add: require(realpath(dirname(__FILE__) . '/../../config_bootstrap.php')); to the bottom of system/expressionengine/config/config.php
    * Add require(realpath(dirname(__FILE__) . '/../../config_bootstrap.php')); to the bottom of system/expressionengine/config/database.php
    *
    * Note: If you have moved your site root you'll need to update the require_once path
    *
  16. @leevigraham leevigraham revised this gist Jun 29, 2010. 1 changed file with 4 additions and 5 deletions.
    9 changes: 4 additions & 5 deletions config.php
    Original file line number Diff line number Diff line change
    @@ -3,20 +3,19 @@
    * Custom configuration file for ExpressionEngine
    *
    * Place config.php in your site root
    * Add require(realpath(dirname(__FILE__) . '/../../config.php')); to the bottom of system/expressionengine/config/config.php
    * Add: require(realpath(dirname(__FILE__) . '/../../config.php')); to the bottom of system/expressionengine/config/config.php
    * Add require(realpath(dirname(__FILE__) . '/../../config.php')); to the bottom of system/expressionengine/config/database.php
    *
    * Note: If you have moved your site root you'll need to update the require_once path
    * Asset paths such as member avatars reflect Newism's folder approach not the default EE install
    *
    * Also includes custom DB configuration file based on your environment
    * Asset paths such as member avatars reflect Newism's folder approach not the default EE install
    *
    * Posiible configuration options
    * Also includes custom DB configuration file based on your environment. Possible configuration options:
    *
    * $env_db_config['hostname'] = "localhost";
    * $env_db_config['username'] = "root";
    * $env_db_config['password'] = "";
    * $env_db_config['database'] = "your_database";
    * $env_db_config['cachedir'] = "/yoursite.com/www/system/expressionengine/cache/db_cache/";
    *
    * @author Leevi Graham <http://leevigraham.com>, Technical Director - Newism <http://newism.com.au>
    * @link http://expressionengine.com/wiki/EE_2_Config_Overrides/
  17. @leevigraham leevigraham revised this gist Jun 29, 2010. 1 changed file with 14 additions and 14 deletions.
    28 changes: 14 additions & 14 deletions config.php
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,8 @@
    * Place config.php in your site root
    * Add require(realpath(dirname(__FILE__) . '/../../config.php')); to the bottom of system/expressionengine/config/config.php
    * Add require(realpath(dirname(__FILE__) . '/../../config.php')); to the bottom of system/expressionengine/config/database.php
    * If you have moved your site root you'll need to update the require_once path
    * Note: If you have moved your site root you'll need to update the require_once path
    * Asset paths such as member avatars reflect Newism's folder approach not the default EE install
    *
    * Also includes custom DB configuration file based on your environment
    *
    @@ -15,18 +16,9 @@
    * $env_db_config['username'] = "root";
    * $env_db_config['password'] = "";
    * $env_db_config['database'] = "your_database";
    * $env_db_config['dbdriver'] = "mysql";
    * $env_db_config['dbprefix'] = "exp_";
    * $env_db_config['pconnect'] = FALSE;
    * $env_db_config['swap_pre'] = "exp_";
    * $env_db_config['db_debug'] = TRUE;
    * $env_db_config['cache_on'] = FALSE;
    * $env_db_config['autoinit'] = FALSE;
    * $env_db_config['char_set'] = "utf8";
    * $env_db_config['dbcollat'] = "utf8_general_ci";
    * $env_db_config['cachedir'] = "/yoursite.com//www/system/expressionengine/cache/db_cache/";
    * $env_db_config['cachedir'] = "/yoursite.com/www/system/expressionengine/cache/db_cache/";
    *
    * @author Leevi Graham <http://leevigraham.com>
    * @author Leevi Graham <http://leevigraham.com>, Technical Director - Newism <http://newism.com.au>
    * @link http://expressionengine.com/wiki/EE_2_Config_Overrides/
    */

    @@ -197,12 +189,20 @@
    if(!isset($assign_to_config['global_vars']))
    $assign_to_config['global_vars'] = array();

    $assign_to_config['global_vars'] = array_merge($assign_to_config['global_vars'], $default_global_vars, $env_global_vars);
    $assign_to_config['global_vars'] = array_merge(
    $assign_to_config['global_vars'],
    $default_global_vars,
    $env_global_vars
    );
    }

    // DB bootsrap... GO!
    if(isset($db['expressionengine']))
    {
    $default_db_config = array("cachedir" => APPPATH . "cache/db_cache/");
    $db['expressionengine'] = array_merge($db['expressionengine'], $default_db_config, $env_db_config);
    $db['expressionengine'] = array_merge(
    $db['expressionengine'],
    $default_db_config,
    $env_db_config
    );
    }
  18. @leevigraham leevigraham revised this gist Jun 29, 2010. 1 changed file with 151 additions and 146 deletions.
    297 changes: 151 additions & 146 deletions config.php
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,7 @@
    * $env_db_config['hostname'] = "localhost";
    * $env_db_config['username'] = "root";
    * $env_db_config['password'] = "";
    * $env_db_config['database'] = "EE2_template";
    * $env_db_config['database'] = "your_database";
    * $env_db_config['dbdriver'] = "mysql";
    * $env_db_config['dbprefix'] = "exp_";
    * $env_db_config['pconnect'] = FALSE;
    @@ -24,7 +24,7 @@
    * $env_db_config['autoinit'] = FALSE;
    * $env_db_config['char_set'] = "utf8";
    * $env_db_config['dbcollat'] = "utf8_general_ci";
    * $env_db_config['cachedir'] = "/Users/leevigraham/Sites/Internal/local.ExpressionEngine2.site_template/www/system/expressionengine/cache/db_cache/";
    * $env_db_config['cachedir'] = "/yoursite.com//www/system/expressionengine/cache/db_cache/";
    *
    * @author Leevi Graham <http://leevigraham.com>
    * @link http://expressionengine.com/wiki/EE_2_Config_Overrides/
    @@ -33,15 +33,15 @@
    // Setup the environment
    if(!defined('NSM_ENV'))
    {
    define('NSM_SERVER_NAME', $_SERVER['SERVER_NAME']);
    define('NSM_SITE_URL', 'http://'.NSM_SERVER_NAME);
    define('NSM_DOC_ROOT', realpath(dirname(__FILE__)));

    // Set the environment
    if ( strstr( NSM_SERVER_NAME, 'local.' ) ) define('NSM_ENV', 'local');
    elseif( strstr( NSM_SERVER_NAME, 'dev.' ) ) define('NSM_ENV', 'dev');
    elseif( strstr( NSM_SERVER_NAME, 'stage.' ) ) define('NSM_ENV', 'stage');
    else define('NSM_ENV', 'production');
    define('NSM_SERVER_NAME', $_SERVER['SERVER_NAME']);
    define('NSM_SITE_URL', 'http://'.NSM_SERVER_NAME);
    define('NSM_DOC_ROOT', realpath(dirname(__FILE__)));

    // Set the environment
    if ( strstr( NSM_SERVER_NAME, 'local.' ) ) define('NSM_ENV', 'local');
    elseif( strstr( NSM_SERVER_NAME, 'dev.' ) ) define('NSM_ENV', 'dev');
    elseif( strstr( NSM_SERVER_NAME, 'stage.' ) ) define('NSM_ENV', 'stage');
    else define('NSM_ENV', 'production');
    }

    // Define the environment settings
    @@ -52,14 +52,14 @@

    // Set the environmental config and global vars
    if (NSM_ENV == 'local'){
    // $env_config = array();
    $env_db_config = array(
    'host_name' => 'localhost',
    'username' => 'root',
    'password' => '',
    'database' => 'EE2_template'
    );
    // $env_global_vars = array();
    // $env_config = array();
    $env_db_config = array(
    'host_name' => 'localhost',
    'username' => 'root',
    'password' => '',
    'database' => 'your_database'
    );
    // $env_global_vars = array();
    }
    elseif(NSM_ENV == 'dev'){}
    elseif(NSM_ENV == 'stage'){}
    @@ -68,136 +68,141 @@
    // Config bootsrap... GO!
    if(isset($config))
    {
    // Our default config. This shouldn't have to be changed if you're using the Newism EE2 template.
    $default_config = array(

    // Gneral preferences
    'is_system_on' => 'y',
    'license_number' => '',
    'index_page' => '',
    'admin_session_type' => 'cs',
    'new_version_check' => 'y',
    'doc_url' => 'http://expressionengine.com/public_beta/docs/',

    'base_url' => NSM_SITE_URL,
    'cp_url' => NSM_SITE_URL . '/ee-admin/index.php',

    // Site preferences
    // Some of these preferences might actually need to be set in the index.php files.
    // Not sure which ones yet, I'll figure that out when I have my first MSM site.
    'is_site_on' => 'y',
    'site_name' => 'EE Template',
    'site_label' => 'EE Template',
    'site_short_name' => 'default_site',
    'site_description' => '',
    'site_404' => 'site/four04',

    'webmaster_email' => 'admin@' . NSM_SERVER_NAME,
    'webmaster_name' => 'Admin',

    // Localization preferences
    'server_timezone' => 'UP10',
    'server_offset' => FALSE,
    'time_format' => 'eu',
    'daylight_savings' => 'n',
    'honor_entry_dst' => 'y',

    // Channel preferences
    'word_separator' => '-',
    'reserved_category_word' => 'cat',

    // Template preferences
    'strict_urls' => 'y',
    'save_tmpl_files' => 'y',
    'save_tmpl_revisions' => 'y',
    'tmpl_file_basepath' => NSM_DOC_ROOT . '/templates/',

    // Theme preferences
    'theme_folder_path' => NSM_DOC_ROOT . '/content/themes/',
    'theme_folder_url' => NSM_SITE_URL . '/themes/',

    // Tracking preferences
    'enable_online_user_tracking' => 'n',
    'dynamic_tracking_disabling' => '500',
    'enable_hit_tracking' => 'n',
    'enable_entry_view_tracking' => 'n',
    'log_referrers' => 'n',

    // Member preferences
    'allow_member_registration' => 'n',
    'profile_trigger' => '--sdsdjh22kj3hjksdkjhkj2lffgrerfvmdkndkfisolmfmsd',

    'enable_avatars' => 'n',
    'avatar_path' => NSM_DOC_ROOT . '/content/uploads/member_assets/member_avatars/',
    'avatar_url' => NSM_SITE_URL . '/member_assets/member_avatars/',
    'avatar_max_height' => 100,
    'avatar_max_width' => 100,
    'avatar_max_kb' => 100,

    'enable_photos' => 'n',
    'photo_path' => NSM_DOC_ROOT . '/content/uploads/member_assets/member_photos/',
    'photo__url' => NSM_SITE_URL . '/member_assets/member_photos/',
    'photo_max_height' => 200,
    'photo_max_width' => 200,
    'photo_max_kb' => 200,

    'enable_emoticons' => 'n',

    'sig_allow_img_upload' => 'n',
    'sig_img_path' => NSM_DOC_ROOT . '/content/uploads/member_assets/signature_attachments/',
    'sig_img_url' => NSM_SITE_URL . '/member_assets/signature_attachments/',
    'sig_img_max_height' => 80,
    'sig_img_max_width' => 480,
    'sig_img_max_kb' => 30,
    'sig_maxlength' => 500,

    // Capcha preferences
    'captcha_font' => 'y',
    'captcha_rand' => 'y',
    'captcha_require_members' => 'n',
    'captcha_path' => NSM_DOC_ROOT . '/content/images/captchas/',
    'captcha_url' => NSM_SITE_URL . '/images/captchas/',
    );

    // Build the new config object
    $config = array_merge($config, $default_config, $env_config);

    /**
    * Custom global variables
    *
    * This is a bit sucky as they are pulled straight from the $assign_to_config array.
    * See EE_Config.php around line 90 or search for: 'global $assign_to_config;'
    * Output the global vars in your template with:
    * <?php $EE = get_instance(); print('<pre><code>'.print_r($EE->config->_global_vars, TRUE) . '</code></pre>'); ?>
    * Hat tip to: Erskine from EECI2010 Preso: http://eeinsider.com/blog/eeci-2010-how-erskine-rolls-with-ee/
    */

    $default_global_vars = array(
    // General
    'gv_env' => NSM_ENV,
    // Tag parameters
    'gv_param_disable_default' => 'disable="categories|pagination|member_data"',
    'gv_param_disable_all' => 'disable="categories|custom_fields|member_data|pagination"',
    'gv_param_cache_param' => 'cache="yes" refresh="10"',
    '-gv_param_cache_param' => '-cache="yes" refresh="10"', // disable by adding a '-' to the front of the global
    // Date and time
    'gv_date_time' => '%g:%i %a',
    'gv_date_short' => '%F %d, %Y',
    'gv_date_full' => '%F %d %Y, %g:%i %a'
    );

    // Make this global so we can add some of the config variables here
    global $assign_to_config;

    if(!isset($assign_to_config['global_vars']))
    $assign_to_config['global_vars'] = array();

    $assign_to_config['global_vars'] = array_merge($assign_to_config['global_vars'], $default_global_vars, $env_global_vars);
    // Our default config. This shouldn't have to be changed if you're using the Newism EE2 template.
    $default_config = array(

    // Gneral preferences
    'is_system_on' => 'y',
    'license_number' => '',
    'index_page' => '',
    'admin_session_type' => 'cs',
    'new_version_check' => 'y',
    'doc_url' => 'http://expressionengine.com/public_beta/docs/',

    'base_url' => NSM_SITE_URL,
    'cp_url' => NSM_SITE_URL . '/ee-admin/index.php',

    // Site preferences
    // Some of these preferences might actually need to be set in the index.php files.
    // Not sure which ones yet, I'll figure that out when I have my first MSM site.
    'is_site_on' => 'y',
    'site_name' => 'EE Template',
    'site_label' => 'EE Template',
    'site_short_name' => 'default_site',
    'site_description' => '',
    'site_404' => 'site/four04',

    'webmaster_email' => 'admin@' . NSM_SERVER_NAME,
    'webmaster_name' => 'Admin',

    // Localization preferences
    'server_timezone' => 'UP10',
    'server_offset' => FALSE,
    'time_format' => 'eu',
    'daylight_savings' => 'n',
    'honor_entry_dst' => 'y',

    // Channel preferences
    'word_separator' => '-',
    'reserved_category_word' => 'cat',

    // Template preferences
    'strict_urls' => 'y',
    'save_tmpl_files' => 'y',
    'save_tmpl_revisions' => 'y',
    'tmpl_file_basepath' => NSM_DOC_ROOT . '/templates/',

    // Theme preferences
    'theme_folder_path' => NSM_DOC_ROOT . '/content/themes/',
    'theme_folder_url' => NSM_SITE_URL . '/themes/',

    // Tracking preferences
    'enable_online_user_tracking' => 'n',
    'dynamic_tracking_disabling' => '500',
    'enable_hit_tracking' => 'n',
    'enable_entry_view_tracking' => 'n',
    'log_referrers' => 'n',

    // Member preferences
    'allow_member_registration' => 'n',
    'profile_trigger' => '--sdsdjh22kj3hjksdkjhkj2lffgrerfvmdkndkfisolmfmsd',

    'enable_avatars' => 'n',
    'avatar_path' => NSM_DOC_ROOT . '/content/uploads/member_assets/member_avatars/',
    'avatar_url' => NSM_SITE_URL . '/member_assets/member_avatars/',
    'avatar_max_height' => 100,
    'avatar_max_width' => 100,
    'avatar_max_kb' => 100,

    'enable_photos' => 'n',
    'photo_path' => NSM_DOC_ROOT . '/content/uploads/member_assets/member_photos/',
    'photo__url' => NSM_SITE_URL . '/member_assets/member_photos/',
    'photo_max_height' => 200,
    'photo_max_width' => 200,
    'photo_max_kb' => 200,

    'enable_emoticons' => 'n',

    'sig_allow_img_upload' => 'n',
    'sig_img_path' => NSM_DOC_ROOT . '/content/uploads/member_assets/signature_attachments/',
    'sig_img_url' => NSM_SITE_URL . '/member_assets/signature_attachments/',
    'sig_img_max_height' => 80,
    'sig_img_max_width' => 480,
    'sig_img_max_kb' => 30,
    'sig_maxlength' => 500,

    // Capcha preferences
    'captcha_font' => 'y',
    'captcha_rand' => 'y',
    'captcha_require_members' => 'n',
    'captcha_path' => NSM_DOC_ROOT . '/content/images/captchas/',
    'captcha_url' => NSM_SITE_URL . '/images/captchas/',
    );

    // Build the new config object
    $config = array_merge($config, $default_config, $env_config);

    /**
    * Custom global variables
    *
    * This is a bit sucky as they are pulled straight from the $assign_to_config array.
    * See EE_Config.php around line 90 or search for: 'global $assign_to_config;'
    * Output the global vars in your template with:
    * <?php $EE = get_instance(); print('<pre><code>'.print_r($EE->config->_global_vars, TRUE) . '</code></pre>'); ?>
    * Hat tip to: Erskine from EECI2010 Preso: http://eeinsider.com/blog/eeci-2010-how-erskine-rolls-with-ee/
    */

    $default_global_vars = array(
    // General
    'gv_env' => NSM_ENV,

    // Tag parameters
    'gv_param_disable_default' => 'disable="categories|pagination|member_data"',
    'gv_param_disable_all' => 'disable="categories|custom_fields|member_data|pagination"',
    'gv_param_cache_param' => 'cache="yes" refresh="10"',
    '-gv_param_cache_param' => '-cache="yes" refresh="10"', // disable by adding a '-' to the front of the global

    // Date and time
    'gv_date_time' => '%g:%i %a',
    'gv_date_short' => '%F %d, %Y',
    'gv_date_full' => '%F %d %Y, %g:%i %a',

    // theme urls
    'gv_theme_url' => '/themes/site_themes/default_site/'
    );

    // Make this global so we can add some of the config variables here
    global $assign_to_config;

    if(!isset($assign_to_config['global_vars']))
    $assign_to_config['global_vars'] = array();

    $assign_to_config['global_vars'] = array_merge($assign_to_config['global_vars'], $default_global_vars, $env_global_vars);
    }

    // DB bootsrap... GO!
    if(isset($db['expressionengine']))
    {
    $default_db_config = array("cachedir" => APPPATH . "cache/db_cache/");
    $db['expressionengine'] = array_merge($db['expressionengine'], $default_db_config, $env_db_config);
    $default_db_config = array("cachedir" => APPPATH . "cache/db_cache/");
    $db['expressionengine'] = array_merge($db['expressionengine'], $default_db_config, $env_db_config);
    }
  19. @leevigraham leevigraham revised this gist Jun 23, 2010. 1 changed file with 17 additions and 15 deletions.
    32 changes: 17 additions & 15 deletions config.php
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    * Place config.php in your site root
    * Add require(realpath(dirname(__FILE__) . '/../../config.php')); to the bottom of system/expressionengine/config/config.php
    * Add require(realpath(dirname(__FILE__) . '/../../config.php')); to the bottom of system/expressionengine/config/database.php
    * If you have moved your site root you'll need to update the require path
    * If you have moved your site root you'll need to update the require_once path
    *
    * Also includes custom DB configuration file based on your environment
    *
    @@ -30,35 +30,36 @@
    * @link http://expressionengine.com/wiki/EE_2_Config_Overrides/
    */

    // Define some environment variables
    // Setup the environment
    if(!defined('NSM_ENV'))
    {
    define('NSM_SERVER_NAME', $_SERVER['SERVER_NAME']);
    define('NSM_SITE_URL', 'http://'.NSM_SERVER_NAME);
    define('NSM_DOC_ROOT', realpath(dirname(__FILE__)));

    // Set the environment
    if ( strstr( NSM_SERVER_NAME, 'local' ) ) define('NSM_ENV', 'local');
    elseif( strstr( NSM_SERVER_NAME, 'dev' ) ) define('NSM_ENV', 'dev');
    elseif( strstr( NSM_SERVER_NAME, 'stage' ) ) define('NSM_ENV', 'stage');
    if ( strstr( NSM_SERVER_NAME, 'local.' ) ) define('NSM_ENV', 'local');
    elseif( strstr( NSM_SERVER_NAME, 'dev.' ) ) define('NSM_ENV', 'dev');
    elseif( strstr( NSM_SERVER_NAME, 'stage.' ) ) define('NSM_ENV', 'stage');
    else define('NSM_ENV', 'production');
    }

    // Placeholder arrays
    // Define the environment settings

    $env_config = array();
    $env_db_config = array();
    $env_global_vars = array();

    // Set the environmental config and global vars
    if (NSM_ENV == 'local'){
    $env_config = array();
    // $env_config = array();
    $env_db_config = array(
    'host_name' => 'localhost',
    'username' => 'root',
    'password' => '',
    'database' => 'EE2_template'
    );
    $env_global_vars = array();
    // $env_global_vars = array();
    }
    elseif(NSM_ENV == 'dev'){}
    elseif(NSM_ENV == 'stage'){}
    @@ -82,6 +83,8 @@
    'cp_url' => NSM_SITE_URL . '/ee-admin/index.php',

    // Site preferences
    // Some of these preferences might actually need to be set in the index.php files.
    // Not sure which ones yet, I'll figure that out when I have my first MSM site.
    'is_site_on' => 'y',
    'site_name' => 'EE Template',
    'site_label' => 'EE Template',
    @@ -98,7 +101,6 @@
    'time_format' => 'eu',
    'daylight_savings' => 'n',
    'honor_entry_dst' => 'y',


    // Channel preferences
    'word_separator' => '-',
    @@ -169,11 +171,6 @@
    * <?php $EE = get_instance(); print('<pre><code>'.print_r($EE->config->_global_vars, TRUE) . '</code></pre>'); ?>
    * Hat tip to: Erskine from EECI2010 Preso: http://eeinsider.com/blog/eeci-2010-how-erskine-rolls-with-ee/
    */
    // Make this global so we can add some of the config variables here
    global $assign_to_config;

    if(!isset($assign_to_config['global_vars']))
    $assign_to_config['global_vars'] = array();

    $default_global_vars = array(
    // General
    @@ -189,13 +186,18 @@
    'gv_date_full' => '%F %d %Y, %g:%i %a'
    );

    // Make this global so we can add some of the config variables here
    global $assign_to_config;

    if(!isset($assign_to_config['global_vars']))
    $assign_to_config['global_vars'] = array();

    $assign_to_config['global_vars'] = array_merge($assign_to_config['global_vars'], $default_global_vars, $env_global_vars);
    }

    // DB bootsrap... GO!
    if(isset($db['expressionengine']))
    {
    //print_r($db['expressionengine']);
    $default_db_config = array("cachedir" => APPPATH . "cache/db_cache/");
    $db['expressionengine'] = array_merge($db['expressionengine'], $default_db_config, $env_db_config);
    }
  20. @leevigraham leevigraham revised this gist Jun 23, 2010. 2 changed files with 171 additions and 172 deletions.
    288 changes: 171 additions & 117 deletions config.php
    Original file line number Diff line number Diff line change
    @@ -1,147 +1,201 @@
    <?php

    /**
    * Custom configuration file for ExpressionEngine
    *
    * Place config.php in your site root
    * Add require(realpath(dirname(__FILE__)."/../../config.php")); to the bottom of system/expressionengine/config/config.php
    * If you have moved your site root you'll need to update the require_once path
    * Add require(realpath(dirname(__FILE__) . '/../../config.php')); to the bottom of system/expressionengine/config/config.php
    * Add require(realpath(dirname(__FILE__) . '/../../config.php')); to the bottom of system/expressionengine/config/database.php
    * If you have moved your site root you'll need to update the require path
    *
    * Also includes custom DB configuration file based on your environment
    *
    * Posiible configuration options
    *
    * $env_db_config['hostname'] = "localhost";
    * $env_db_config['username'] = "root";
    * $env_db_config['password'] = "";
    * $env_db_config['database'] = "EE2_template";
    * $env_db_config['dbdriver'] = "mysql";
    * $env_db_config['dbprefix'] = "exp_";
    * $env_db_config['pconnect'] = FALSE;
    * $env_db_config['swap_pre'] = "exp_";
    * $env_db_config['db_debug'] = TRUE;
    * $env_db_config['cache_on'] = FALSE;
    * $env_db_config['autoinit'] = FALSE;
    * $env_db_config['char_set'] = "utf8";
    * $env_db_config['dbcollat'] = "utf8_general_ci";
    * $env_db_config['cachedir'] = "/Users/leevigraham/Sites/Internal/local.ExpressionEngine2.site_template/www/system/expressionengine/cache/db_cache/";
    *
    * @author Leevi Graham <http://leevigraham.com>
    * @link http://expressionengine.com/wiki/EE_2_Config_Overrides/
    */

    // Define some environment variables
    if(!defined("NSM_ENV"))
    if(!defined('NSM_ENV'))
    {
    define("NSM_SERVER_NAME", $_SERVER['SERVER_NAME']);
    define("NSM_SITE_URL", "http://".NSM_SERVER_NAME);
    define("NSM_DOC_ROOT", realpath(dirname(__FILE__)));
    define('NSM_SERVER_NAME', $_SERVER['SERVER_NAME']);
    define('NSM_SITE_URL', 'http://'.NSM_SERVER_NAME);
    define('NSM_DOC_ROOT', realpath(dirname(__FILE__)));

    // Set the environment
    if ( strstr( NSM_SERVER_NAME, 'local' ) ) define("NSM_ENV", "local");
    elseif( strstr( NSM_SERVER_NAME, 'dev' ) ) define("NSM_ENV", "dev");
    elseif( strstr( NSM_SERVER_NAME, 'stage' ) ) define("NSM_ENV", "stage");
    else define("NSM_ENV", "production");
    if ( strstr( NSM_SERVER_NAME, 'local' ) ) define('NSM_ENV', 'local');
    elseif( strstr( NSM_SERVER_NAME, 'dev' ) ) define('NSM_ENV', 'dev');
    elseif( strstr( NSM_SERVER_NAME, 'stage' ) ) define('NSM_ENV', 'stage');
    else define('NSM_ENV', 'production');
    }

    // Placeholder arrays
    $env_config = array();
    $env_db_config = array();
    $env_global_vars = array();

    // Set the environmental config and global vars
    if (NSM_ENV == 'local'){
    $env_config = array();
    $env_db_config = array(
    'host_name' => 'localhost',
    'username' => 'root',
    'password' => '',
    'database' => 'EE2_template'
    );
    $env_global_vars = array();
    }
    elseif(NSM_ENV == 'dev'){}
    elseif(NSM_ENV == 'stage'){}
    else{}

    // Our default config. This shouldn't have to be changed if you're using the Newism EE2 template.
    $default_config = array(

    // System preferences
    "is_system_on" => "y",
    "admin_session_type" => "cs",

    "base_url" => NSM_SITE_URL,
    "cp_url" => NSM_SITE_URL . "/ee-admin/index.php",
    "index_page" => "",

    // Site preferences
    "is_site_on" => "y",
    "site_name" => "EE Template",
    "site_label" => "EE Template",
    "site_short_name" => "default_site",
    "site_description" => "",
    "site_404" => "site/four04",

    "webmaster_email" => "admin@" . NSM_SERVER_NAME,
    "webmaster_name" => "Admin",

    // Server preferences
    "server_timezone" => "UP10",
    "server_offset" => FALSE,

    // Channel preferences
    "word_separator" => "-",
    "reserved_category_word" => "cat",

    // Template preferences
    "strict_urls" => "y",
    "save_tmpl_files" => "y",
    "save_tmpl_revisions" => "y",
    "tmpl_file_basepath" => NSM_DOC_ROOT . "/templates/",

    // Theme preferences
    "theme_folder_path" => NSM_DOC_ROOT . "/content/themes/",
    "theme_folder_url" => NSM_SITE_URL . "/themes/",

    // Member preferences
    "allow_member_registration" => "n",
    "profile_trigger" => "--sdsdjh22kj3hjksdkjhkj2lffgrerfvmdkndkfisolmfmsd",

    "enable_avatars" => "n",
    "avatar_path" => NSM_DOC_ROOT . "/content/uploads/member_assets/member_avatars/",
    "avatar_url" => NSM_SITE_URL . "/member_assets/member_avatars/",
    "avatar_max_height" => 100,
    "avatar_max_width" => 100,
    "avatar_max_kb" => 100,

    "enable_photos" => "n",
    "photo_path" => NSM_DOC_ROOT . "/content/uploads/member_assets/member_photos/",
    "photo__url" => NSM_SITE_URL . "/member_assets/member_photos/",
    "photo_max_height" => 200,
    "photo_max_width" => 200,
    "photo_max_kb" => 200,

    "enable_emoticons" => "n",

    "sig_allow_img_upload" => "n",
    "sig_img_path" => NSM_DOC_ROOT . "/content/uploads/member_assets/signature_attachments/",
    "sig_img_url" => NSM_SITE_URL . "/member_assets/signature_attachments/",
    "sig_img_max_height" => 80,
    "sig_img_max_width" => 480,
    "sig_img_max_kb" => 30,
    "sig_maxlength" => 500,

    // Capcha preferences
    "captcha_font" => "y",
    "captcha_rand" => "y",
    "captcha_require_members" => "n",
    "captcha_path" => NSM_DOC_ROOT . "/content/images/captchas/",
    "captcha_url" => NSM_SITE_URL . "/images/captchas/",
    );

    // Build the new config object
    $config = array_merge($config, $default_config, $env_config);

    /**
    * Custom global variables
    *
    * This is a bit sucky as they are pulled straight from the $assign_to_config array.
    * See EE_Config.php around line 90 or search for: "global $assign_to_config;"
    * Output the global vars in your template with:
    * <?php $EE = get_instance(); print("<pre><code>".print_r($EE->config->_global_vars, TRUE) . "</code></pre>"); ?>
    * Hat tip to: Erskine from EECI2010 Preso: http://eeinsider.com/blog/eeci-2010-how-erskine-rolls-with-ee/
    */
    // Config bootsrap... GO!
    if(isset($config))
    {
    // Our default config. This shouldn't have to be changed if you're using the Newism EE2 template.
    $default_config = array(

    // Gneral preferences
    'is_system_on' => 'y',
    'license_number' => '',
    'index_page' => '',
    'admin_session_type' => 'cs',
    'new_version_check' => 'y',
    'doc_url' => 'http://expressionengine.com/public_beta/docs/',

    'base_url' => NSM_SITE_URL,
    'cp_url' => NSM_SITE_URL . '/ee-admin/index.php',

    // Site preferences
    'is_site_on' => 'y',
    'site_name' => 'EE Template',
    'site_label' => 'EE Template',
    'site_short_name' => 'default_site',
    'site_description' => '',
    'site_404' => 'site/four04',

    'webmaster_email' => 'admin@' . NSM_SERVER_NAME,
    'webmaster_name' => 'Admin',

    // Localization preferences
    'server_timezone' => 'UP10',
    'server_offset' => FALSE,
    'time_format' => 'eu',
    'daylight_savings' => 'n',
    'honor_entry_dst' => 'y',


    // Channel preferences
    'word_separator' => '-',
    'reserved_category_word' => 'cat',

    // Template preferences
    'strict_urls' => 'y',
    'save_tmpl_files' => 'y',
    'save_tmpl_revisions' => 'y',
    'tmpl_file_basepath' => NSM_DOC_ROOT . '/templates/',

    // Theme preferences
    'theme_folder_path' => NSM_DOC_ROOT . '/content/themes/',
    'theme_folder_url' => NSM_SITE_URL . '/themes/',

    // Tracking preferences
    'enable_online_user_tracking' => 'n',
    'dynamic_tracking_disabling' => '500',
    'enable_hit_tracking' => 'n',
    'enable_entry_view_tracking' => 'n',
    'log_referrers' => 'n',

    // Member preferences
    'allow_member_registration' => 'n',
    'profile_trigger' => '--sdsdjh22kj3hjksdkjhkj2lffgrerfvmdkndkfisolmfmsd',

    'enable_avatars' => 'n',
    'avatar_path' => NSM_DOC_ROOT . '/content/uploads/member_assets/member_avatars/',
    'avatar_url' => NSM_SITE_URL . '/member_assets/member_avatars/',
    'avatar_max_height' => 100,
    'avatar_max_width' => 100,
    'avatar_max_kb' => 100,

    'enable_photos' => 'n',
    'photo_path' => NSM_DOC_ROOT . '/content/uploads/member_assets/member_photos/',
    'photo__url' => NSM_SITE_URL . '/member_assets/member_photos/',
    'photo_max_height' => 200,
    'photo_max_width' => 200,
    'photo_max_kb' => 200,

    'enable_emoticons' => 'n',

    'sig_allow_img_upload' => 'n',
    'sig_img_path' => NSM_DOC_ROOT . '/content/uploads/member_assets/signature_attachments/',
    'sig_img_url' => NSM_SITE_URL . '/member_assets/signature_attachments/',
    'sig_img_max_height' => 80,
    'sig_img_max_width' => 480,
    'sig_img_max_kb' => 30,
    'sig_maxlength' => 500,

    // Capcha preferences
    'captcha_font' => 'y',
    'captcha_rand' => 'y',
    'captcha_require_members' => 'n',
    'captcha_path' => NSM_DOC_ROOT . '/content/images/captchas/',
    'captcha_url' => NSM_SITE_URL . '/images/captchas/',
    );

    // Build the new config object
    $config = array_merge($config, $default_config, $env_config);

    /**
    * Custom global variables
    *
    * This is a bit sucky as they are pulled straight from the $assign_to_config array.
    * See EE_Config.php around line 90 or search for: 'global $assign_to_config;'
    * Output the global vars in your template with:
    * <?php $EE = get_instance(); print('<pre><code>'.print_r($EE->config->_global_vars, TRUE) . '</code></pre>'); ?>
    * Hat tip to: Erskine from EECI2010 Preso: http://eeinsider.com/blog/eeci-2010-how-erskine-rolls-with-ee/
    */
    // Make this global so we can add some of the config variables here
    global $assign_to_config;

    if(!isset($assign_to_config['global_vars']))
    $assign_to_config['global_vars'] = array();

    $default_global_vars = array(
    // General
    'gv_env' => NSM_ENV,
    // Tag parameters
    'gv_param_disable_default' => 'disable="categories|pagination|member_data"',
    'gv_param_disable_all' => 'disable="categories|custom_fields|member_data|pagination"',
    'gv_param_cache_param' => 'cache="yes" refresh="10"',
    '-gv_param_cache_param' => '-cache="yes" refresh="10"', // disable by adding a '-' to the front of the global
    // Date and time
    'gv_date_time' => '%g:%i %a',
    'gv_date_short' => '%F %d, %Y',
    'gv_date_full' => '%F %d %Y, %g:%i %a'
    );

    $assign_to_config['global_vars'] = array_merge($assign_to_config['global_vars'], $default_global_vars, $env_global_vars);
    }

    // Make this global so we can add some of the config variables here
    global $assign_to_config;

    $default_global_vars = array(
    // General
    'gv_env' => NSM_ENV,
    // Tag parameters
    'gv_param_disable_default' => 'disable="categories|pagination|member_data"',
    'gv_param_disable_all' => 'disable="categories|custom_fields|member_data|pagination"',
    'gv_param_cache_param' => 'cache="yes" refresh="10"',
    '-gv_param_cache_param' => '-cache="yes" refresh="10"', // disable by adding a "-" to the front of the global
    // Date and time
    'gv_date_time' => '%g:%i %a',
    'gv_date_short' => '%F %d, %Y',
    'gv_date_full' => '%F %d %Y, %g:%i %a'
    );

    $assign_to_config['global_vars'] = array_merge($default_global_vars, $env_global_vars);
    // DB bootsrap... GO!
    if(isset($db['expressionengine']))
    {
    //print_r($db['expressionengine']);
    $default_db_config = array("cachedir" => APPPATH . "cache/db_cache/");
    $db['expressionengine'] = array_merge($db['expressionengine'], $default_db_config, $env_db_config);
    }
    55 changes: 0 additions & 55 deletions config_db.php
    Original file line number Diff line number Diff line change
    @@ -1,55 +0,0 @@
    <?php
    /**
    * Custom configuration file for ExpressionEngine
    *
    * Plase config_db.php in your site root
    * Add require_once(realpath(dirname(__FILE__) . "/../../config_db.php")); to the bottom of system/expressionengineconfig/database.php
    * If you have moved your site root you'll need to update the require_once path
    *
    * Configuration Options
    *
    * $env_db['hostname'] = "localhost";
    * $env_db['username'] = "root";
    * $env_db['password'] = "";
    * $env_db['database'] = "EE2_template";
    * $env_db['dbdriver'] = "mysql";
    * $env_db['dbprefix'] = "exp_";
    * $env_db['pconnect'] = FALSE;
    * $env_db['swap_pre'] = "exp_";
    * $env_db['db_debug'] = TRUE;
    * $env_db['cache_on'] = FALSE;
    * $env_db['autoinit'] = FALSE;
    * $env_db['char_set'] = "utf8";
    * $env_db['dbcollat'] = "utf8_general_ci";
    * $env_db['cachedir'] = "/Users/leevigraham/Sites/Internal/local.ExpressionEngine2.site_template/www/system/expressionengine/cache/db_cache/";
    *
    * @author Leevi Graham <http://leevigraham.com>
    * @link http://expressionengine.com/wiki/EE_2_Config_Overrides/
    */

    // Default options
    $default_db_config = array("cachedir" => APPPATH . "cache/db_cache/");

    // Override the db config with environment variables
    $env_db_config = array();

    // Local environment
    if (NSM_ENV == 'local')
    $env_db_config = array(
    'host_name' => 'localhost',
    'username' => 'root',
    'password' => '',
    'database' => 'EE2_template'
    );
    // Development environment
    elseif(NSM_ENV == 'dev')
    $env_db_config = array();
    // Staging environment
    elseif(NSM_ENV == 'stage')
    $env_db_config = array();
    // Production environment
    else
    $env_db_config = array();

    // Merge all the db config together with default options
    $db['expressionengine'] = array_merge($db['expressionengine'], $default_db_config, $env_db_config);
  21. @leevigraham leevigraham revised this gist Jun 23, 2010. 2 changed files with 46 additions and 13 deletions.
    57 changes: 45 additions & 12 deletions config.php
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,7 @@
    * @author Leevi Graham <http://leevigraham.com>
    * @link http://expressionengine.com/wiki/EE_2_Config_Overrides/
    */

    // Define some environment variables
    if(!defined("NSM_ENV"))
    {
    @@ -24,19 +25,23 @@
    else define("NSM_ENV", "production");
    }

    // Override the config with environment variables
    // Placeholder arrays
    $env_config = array();
    $env_global_vars = array();

    // Set the environmental config and global vars
    if (NSM_ENV == 'local'){
    $env_config = array(
    "global_vars" => array(
    "foo" => "bar"
    )
    );
    $env_config = array();
    $env_global_vars = array();
    }
    elseif(NSM_ENV == 'dev'){ $env_config = array(); }
    elseif(NSM_ENV == 'stage'){ $env_config = array(); }
    else{ $env_config = array(); }
    elseif(NSM_ENV == 'dev'){}
    elseif(NSM_ENV == 'stage'){}
    else{}

    // Our default config. This shouldn't have to be changed if you're using the Newism EE2 template.
    $default_config = array(

    // System preferences
    "is_system_on" => "y",
    "admin_session_type" => "cs",

    @@ -55,13 +60,12 @@
    "webmaster_email" => "admin@" . NSM_SERVER_NAME,
    "webmaster_name" => "Admin",

    "word_separator" => "-",

    // Server preferences
    "server_timezone" => "UP10",
    "server_offset" => FALSE,

    // Channel preferences
    "word_separator" => "-",
    "reserved_category_word" => "cat",

    // Template preferences
    @@ -111,4 +115,33 @@
    );

    // Build the new config object
    $config = array_merge($config, $default_config, $env_config);
    $config = array_merge($config, $default_config, $env_config);

    /**
    * Custom global variables
    *
    * This is a bit sucky as they are pulled straight from the $assign_to_config array.
    * See EE_Config.php around line 90 or search for: "global $assign_to_config;"
    * Output the global vars in your template with:
    * <?php $EE = get_instance(); print("<pre><code>".print_r($EE->config->_global_vars, TRUE) . "</code></pre>"); ?>
    * Hat tip to: Erskine from EECI2010 Preso: http://eeinsider.com/blog/eeci-2010-how-erskine-rolls-with-ee/
    */

    // Make this global so we can add some of the config variables here
    global $assign_to_config;

    $default_global_vars = array(
    // General
    'gv_env' => NSM_ENV,
    // Tag parameters
    'gv_param_disable_default' => 'disable="categories|pagination|member_data"',
    'gv_param_disable_all' => 'disable="categories|custom_fields|member_data|pagination"',
    'gv_param_cache_param' => 'cache="yes" refresh="10"',
    '-gv_param_cache_param' => '-cache="yes" refresh="10"', // disable by adding a "-" to the front of the global
    // Date and time
    'gv_date_time' => '%g:%i %a',
    'gv_date_short' => '%F %d, %Y',
    'gv_date_full' => '%F %d %Y, %g:%i %a'
    );

    $assign_to_config['global_vars'] = array_merge($default_global_vars, $env_global_vars);
    2 changes: 1 addition & 1 deletion config_db.php
    Original file line number Diff line number Diff line change
    @@ -52,4 +52,4 @@
    $env_db_config = array();

    // Merge all the db config together with default options
    $db['expressionengine'] = array_merge( $db['expressionengine'], $default_db_config, $env_db_config);
    $db['expressionengine'] = array_merge($db['expressionengine'], $default_db_config, $env_db_config);
  22. @invalid-email-address Anonymous revised this gist Jun 23, 2010. 2 changed files with 146 additions and 87 deletions.
    178 changes: 91 additions & 87 deletions config.php
    Original file line number Diff line number Diff line change
    @@ -1,21 +1,21 @@
    <?php if (!defined('EXT')) exit('Invalid file request');
    <?php

    /**
    * Custom configuration file for ExpressionEngine
    *
    * Place config.php in your site root
    * Add require(realpath(dirname(__FILE__)."/../../config.php")); to the bottom of system/expressionengine/config/config.php
    * If you have moved your site root you'll need to update the require_once path
    *
    * @author Leevi Graham <http://leevigraham.com>
    * @link http://expressionengine.com/wiki/EE_2_Config_Overrides/
    */

    // error_reporting(E_ALL);

    // Define some environment variables
    if(!defined("NSM_ENV"))
    {
    define("NSM_SERVER_NAME", $_SERVER['SERVER_NAME']);
    define("NSM_SITE_URL", "http://".NSM_SERVER_NAME);
    define("NSM_SYSTEM_FOLDER", "system");
    define("NSM_APP_ROOT", realpath(dirname(__FILE__)) . '/www/');
    define("NSM_DOC_ROOT", realpath(dirname(__FILE__)));

    // Set the environment
    if ( strstr( NSM_SERVER_NAME, 'local' ) ) define("NSM_ENV", "local");
    @@ -24,87 +24,91 @@
    else define("NSM_ENV", "production");
    }


    // Override the config with environment variables
    if (NSM_ENV == 'local') $env_config = array();
    elseif(NSM_ENV == 'dev') $env_config = array();
    elseif(NSM_ENV == 'stage') $env_config = array();
    else $env_config = array();
    if (NSM_ENV == 'local'){
    $env_config = array(
    "global_vars" => array(
    "foo" => "bar"
    )
    );
    }
    elseif(NSM_ENV == 'dev'){ $env_config = array(); }
    elseif(NSM_ENV == 'stage'){ $env_config = array(); }
    else{ $env_config = array(); }

    $default_config = array(
    "is_system_on" => "y",
    "admin_session_type" => "cs",

    "base_url" => NSM_SITE_URL,
    "cp_url" => NSM_SITE_URL . "/ee-admin/index.php",
    "index_page" => "",

    // Site preferences
    "is_site_on" => "y",
    "site_name" => "EE Template",
    "site_label" => "EE Template",
    "site_short_name" => "default_site",
    "site_description" => "",
    "site_404" => "site/four04",

    "webmaster_email" => "admin@" . NSM_SERVER_NAME,
    "webmaster_name" => "Admin",

    "word_separator" => "-",

    // Server preferences
    "server_timezone" => "UP10",
    "server_offset" => FALSE,

    // Channel preferences
    "reserved_category_word" => "cat",

    // Template preferences
    "strict_urls" => "y",
    "save_tmpl_files" => "y",
    "save_tmpl_revisions" => "y",
    "tmpl_file_basepath" => NSM_DOC_ROOT . "/templates/",

    // Theme preferences
    "theme_folder_path" => NSM_DOC_ROOT . "/content/themes/",
    "theme_folder_url" => NSM_SITE_URL . "/themes/",

    // Member preferences
    "allow_member_registration" => "n",
    "profile_trigger" => "--sdsdjh22kj3hjksdkjhkj2lffgrerfvmdkndkfisolmfmsd",

    "enable_avatars" => "n",
    "avatar_path" => NSM_DOC_ROOT . "/content/uploads/member_assets/member_avatars/",
    "avatar_url" => NSM_SITE_URL . "/member_assets/member_avatars/",
    "avatar_max_height" => 100,
    "avatar_max_width" => 100,
    "avatar_max_kb" => 100,

    "enable_photos" => "n",
    "photo_path" => NSM_DOC_ROOT . "/content/uploads/member_assets/member_photos/",
    "photo__url" => NSM_SITE_URL . "/member_assets/member_photos/",
    "photo_max_height" => 200,
    "photo_max_width" => 200,
    "photo_max_kb" => 200,

    "enable_emoticons" => "n",

    "sig_allow_img_upload" => "n",
    "sig_img_path" => NSM_DOC_ROOT . "/content/uploads/member_assets/signature_attachments/",
    "sig_img_url" => NSM_SITE_URL . "/member_assets/signature_attachments/",
    "sig_img_max_height" => 80,
    "sig_img_max_width" => 480,
    "sig_img_max_kb" => 30,
    "sig_maxlength" => 500,

    // Capcha preferences
    "captcha_font" => "y",
    "captcha_rand" => "y",
    "captcha_require_members" => "n",
    "captcha_path" => NSM_DOC_ROOT . "/content/images/captchas/",
    "captcha_url" => NSM_SITE_URL . "/images/captchas/",
    );

    // Build the new config object
    $config = array_merge(
    $config,
    array(
    "is_system_on" => "y",
    "admin_session_type" => "cs",

    "base_url" => NSM_SITE_URL,
    "cp_url" => NSM_SITE_URL . "/system/index.php",
    "index_page" => "",

    // Site preferences
    "is_site_on" => "y",
    "site_name" => "EE Template",
    "site_short_name" => "default_site",
    "site_description" => "",
    "site_404" => "site/four04",

    "webmaster_email" => "admin@" . NSM_SERVER_NAME,
    "webmaster_name" => "Admin",

    "word_separator" => "-",

    // Server preferences
    "server_timezone" => "UP10",
    "server_offset" => FALSE,

    // Channel preferences
    "reserved_category_word" => "cat",

    // Template preferences
    "strict_urls" => "y",
    "save_tmpl_files" => "y",
    "save_tmpl_revisions" => "y",
    "tmpl_file_basepath" => NSM_APP_ROOT . "templates/",

    // Theme preferences
    "theme_folder_path" => NSM_APP_ROOT."themes/",
    "theme_folder_url" => NSM_SITE_URL . "/themes/",

    // Member preferences
    "allow_member_registration" => "n",
    "profile_trigger" => "--sdsdjh22kj3hjksdkjhkj2lffgrerfvmdkndkfisolmfmsd",

    "enable_avatars" => "n",
    "avatar_path" => NSM_APP_ROOT . "uploads/member_assets/member_avatars/",
    "avatar_url" => NSM_SITE_URL . "/member_assets/member_avatars/",
    "avatar_max_height" => 100,
    "avatar_max_width" => 100,
    "avatar_max_kb" => 100,

    "enable_photos" => "n",
    "photo_path" => NSM_APP_ROOT . "uploads/member_assets/member_photos/",
    "photo__url" => NSM_SITE_URL . "/member_assets/member_photos/",
    "photo_max_height" => 200,
    "photo_max_width" => 200,
    "photo_max_kb" => 200,

    "enable_emoticons" => "n",

    "sig_allow_img_upload" => "n",
    "sig_img_path" => NSM_APP_ROOT . "uploads/member_assets/signature_attachments/",
    "sig_img_url" => NSM_SITE_URL . "/member_assets/signature_attachments/",
    "sig_img_max_height" => 80,
    "sig_img_max_width" => 480,
    "sig_img_max_kb" => 30,
    "sig_maxlength" => 500,

    // Capcha preferences
    "captcha_font" => "y",
    "captcha_path" => NSM_APP_ROOT . "images/captchas/",
    "captcha_rand" => "y",
    "captcha_require_members" => "n",
    "captcha_url" => NSM_SITE_URL . "/images/captchas/",

    ),
    $env_config);
    $config = array_merge($config, $default_config, $env_config);
    55 changes: 55 additions & 0 deletions config_db.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,55 @@
    <?php
    /**
    * Custom configuration file for ExpressionEngine
    *
    * Plase config_db.php in your site root
    * Add require_once(realpath(dirname(__FILE__) . "/../../config_db.php")); to the bottom of system/expressionengineconfig/database.php
    * If you have moved your site root you'll need to update the require_once path
    *
    * Configuration Options
    *
    * $env_db['hostname'] = "localhost";
    * $env_db['username'] = "root";
    * $env_db['password'] = "";
    * $env_db['database'] = "EE2_template";
    * $env_db['dbdriver'] = "mysql";
    * $env_db['dbprefix'] = "exp_";
    * $env_db['pconnect'] = FALSE;
    * $env_db['swap_pre'] = "exp_";
    * $env_db['db_debug'] = TRUE;
    * $env_db['cache_on'] = FALSE;
    * $env_db['autoinit'] = FALSE;
    * $env_db['char_set'] = "utf8";
    * $env_db['dbcollat'] = "utf8_general_ci";
    * $env_db['cachedir'] = "/Users/leevigraham/Sites/Internal/local.ExpressionEngine2.site_template/www/system/expressionengine/cache/db_cache/";
    *
    * @author Leevi Graham <http://leevigraham.com>
    * @link http://expressionengine.com/wiki/EE_2_Config_Overrides/
    */

    // Default options
    $default_db_config = array("cachedir" => APPPATH . "cache/db_cache/");

    // Override the db config with environment variables
    $env_db_config = array();

    // Local environment
    if (NSM_ENV == 'local')
    $env_db_config = array(
    'host_name' => 'localhost',
    'username' => 'root',
    'password' => '',
    'database' => 'EE2_template'
    );
    // Development environment
    elseif(NSM_ENV == 'dev')
    $env_db_config = array();
    // Staging environment
    elseif(NSM_ENV == 'stage')
    $env_db_config = array();
    // Production environment
    else
    $env_db_config = array();

    // Merge all the db config together with default options
    $db['expressionengine'] = array_merge( $db['expressionengine'], $default_db_config, $env_db_config);
  23. @invalid-email-address Anonymous created this gist Jun 22, 2010.
    110 changes: 110 additions & 0 deletions config.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,110 @@
    <?php if (!defined('EXT')) exit('Invalid file request');

    /**
    * Custom configuration file for ExpressionEngine
    *
    * @author Leevi Graham <http://leevigraham.com>
    * @link http://expressionengine.com/wiki/EE_2_Config_Overrides/
    */

    // error_reporting(E_ALL);

    // Define some environment variables
    if(!defined("NSM_ENV"))
    {
    define("NSM_SERVER_NAME", $_SERVER['SERVER_NAME']);
    define("NSM_SITE_URL", "http://".NSM_SERVER_NAME);
    define("NSM_SYSTEM_FOLDER", "system");
    define("NSM_APP_ROOT", realpath(dirname(__FILE__)) . '/www/');

    // Set the environment
    if ( strstr( NSM_SERVER_NAME, 'local' ) ) define("NSM_ENV", "local");
    elseif( strstr( NSM_SERVER_NAME, 'dev' ) ) define("NSM_ENV", "dev");
    elseif( strstr( NSM_SERVER_NAME, 'stage' ) ) define("NSM_ENV", "stage");
    else define("NSM_ENV", "production");
    }


    // Override the config with environment variables
    if (NSM_ENV == 'local') $env_config = array();
    elseif(NSM_ENV == 'dev') $env_config = array();
    elseif(NSM_ENV == 'stage') $env_config = array();
    else $env_config = array();

    // Build the new config object
    $config = array_merge(
    $config,
    array(
    "is_system_on" => "y",
    "admin_session_type" => "cs",

    "base_url" => NSM_SITE_URL,
    "cp_url" => NSM_SITE_URL . "/system/index.php",
    "index_page" => "",

    // Site preferences
    "is_site_on" => "y",
    "site_name" => "EE Template",
    "site_short_name" => "default_site",
    "site_description" => "",
    "site_404" => "site/four04",

    "webmaster_email" => "admin@" . NSM_SERVER_NAME,
    "webmaster_name" => "Admin",

    "word_separator" => "-",

    // Server preferences
    "server_timezone" => "UP10",
    "server_offset" => FALSE,

    // Channel preferences
    "reserved_category_word" => "cat",

    // Template preferences
    "strict_urls" => "y",
    "save_tmpl_files" => "y",
    "save_tmpl_revisions" => "y",
    "tmpl_file_basepath" => NSM_APP_ROOT . "templates/",

    // Theme preferences
    "theme_folder_path" => NSM_APP_ROOT."themes/",
    "theme_folder_url" => NSM_SITE_URL . "/themes/",

    // Member preferences
    "allow_member_registration" => "n",
    "profile_trigger" => "--sdsdjh22kj3hjksdkjhkj2lffgrerfvmdkndkfisolmfmsd",

    "enable_avatars" => "n",
    "avatar_path" => NSM_APP_ROOT . "uploads/member_assets/member_avatars/",
    "avatar_url" => NSM_SITE_URL . "/member_assets/member_avatars/",
    "avatar_max_height" => 100,
    "avatar_max_width" => 100,
    "avatar_max_kb" => 100,

    "enable_photos" => "n",
    "photo_path" => NSM_APP_ROOT . "uploads/member_assets/member_photos/",
    "photo__url" => NSM_SITE_URL . "/member_assets/member_photos/",
    "photo_max_height" => 200,
    "photo_max_width" => 200,
    "photo_max_kb" => 200,

    "enable_emoticons" => "n",

    "sig_allow_img_upload" => "n",
    "sig_img_path" => NSM_APP_ROOT . "uploads/member_assets/signature_attachments/",
    "sig_img_url" => NSM_SITE_URL . "/member_assets/signature_attachments/",
    "sig_img_max_height" => 80,
    "sig_img_max_width" => 480,
    "sig_img_max_kb" => 30,
    "sig_maxlength" => 500,

    // Capcha preferences
    "captcha_font" => "y",
    "captcha_path" => NSM_APP_ROOT . "images/captchas/",
    "captcha_rand" => "y",
    "captcha_require_members" => "n",
    "captcha_url" => NSM_SITE_URL . "/images/captchas/",

    ),
    $env_config);