ee-garage.com

One config file for local, dev, stage and production environments.

Inspired by Jamie Pittocks EECI2010 US presentation; The team at Newism re-thought our approach to config files, global variables and deployment in ExpressionEngine 2 and the result is our own config_bootstrap.php file.

Features

  • Multiple environments: Configure multiple environments including databases and server paths
  • Global variables: Set and update early parsed global variables
  • Dynamic: Environment loaded based on the URL

Installation

Installing the config_bootstrap.php file is straight forward if you have some knowledge of server setups and PHP. If you're not comfortable setting up domains or PHP it's probably better if you stick to the default control panel based ExpressionEngine configuration behavior.

  1. Download the latest version
  2. Copy the file to the root of your site
  3. Add:
    require(realpath(dirname(__FILE__) . '/../../config_bootstrap.php'));
    to the bottom of system/expressionengine/config/config.php and system/expressionengine/config/database.php

Note: This file is not for everyone. Each ExpressionEngine install is different so you may need to change the require() path, asset paths or server name conditionals.

Server setup

The unmodified config_bootstrap.php file tests for four different environments based on the first subdomain of the current URL. They are:

  • local.yourdomain.com: Local development environment, generally your laptop or office workstation.
  • dev.yourdomain.com: Continuous development environment, used for shared team based development. Could be in the office or on a remote server
  • stage.yourdomain.com: Staging development environment, a working copy of your site on the live server Used for client previews before live deployment.
  • yourdomain.com: The real deal, the live site.

The config_bootstrap.php file

The current version of Newism's config_bootstrap.php file. View the raw version here.

Releases RSS Feed © Copyright 2014 | Policies All prices shown are in Australian Dollars ($AUD) Newism