jbroadway/elefant — Issue #50: Use env var to switch configurations for dev, staging and prod setups
Author: jbroadway
Created: 2011-11-14 16:26:10+00:00
State: open
Labels: feature

Use an environment variable to load alternate configurations for different servers (development, staging, production), e.g.:

```php
define ('ELEFANT_ENV', (getenv ('ELEFANT_ENV') ? getenv ('ELEFANT_ENV') : 'production');

$conf = parse_ini_file ('conf/' . ELEFANT_ENV . '.php');
```

Then specify your environment in `.htaccess` or your vhost configuration:

```
SetEnv ELEFANT_ENV development
```

* Could also force debugging to be off for production.
* We would also need to update any hard-coded references to `conf/config.php` or split it into `conf/general.php` and env-specific settings like database info into `conf/staging.php` and the like.
* Need to find out how to set environment variables in Nginx