Elefant lets you to specify alternate configurations for your development, staging, and production servers. This takes two steps to setup:
Duplicate the conf/config.php
file and name it after your environment name, e.g. conf/development.php
or conf/staging.php
.
In your .htaccess
or web server configuration, set the ELEFANT_ENV
environment variable. For Apache you would add a line like this:
SetEnv ELEFANT_ENV development
Now you can edit your different configuration files to suit your needs in each separate environment, and Elefant will load the correct one in each context.
To specify the environment on the command line, you can export the variable directly like this:
export ELEFANT_ENV=staging
./elefant version
You can also specify the environment via the --env
option directly in the ./elefant
command:
./elefant --env=staging version
Note that calling a handler directly via php index.php cli/version
does not listen for the --env
option.