-
Notifications
You must be signed in to change notification settings - Fork 3
Configuration Environments
Flextrine has the concept of configuration environments which allow different configuration settings to be used based on the current environment. The following settings are valid for the environment:
- development
- test
- staging
- production
The effect of the environment setting is simply to tell Flextrine which yml configuration file to use in the application's config directory. For example, if your application is called myapp
and the environment is set to development
, Flextrine will use the configuration file at /myapp/config/development.yml
.
The environment can be set in the following ways (with highest priority first):
The recommended way to set the environment is via the FLEXTRINE_ENV
environment variable (this needs to be set in such a way that it ends up in PHP's $_ENV or $_SERVER superglobal). This can be done via export
, shell startup script, SetEnv in .htaccess, etc.
You can pass the desired environment as a GET parameter to the gateway. For example:
configuration.gateway = "http://localhost/gateway.php?app=myapp&env=staging";
If no environment is specified, Flextrine will use the default environment set in the main config.yml file. This defaults to development
, so if you do nothing Flextrine will use the /<app>/config/development.yml
file (this is also created by default).
Note that the flextrine app:create
only creates the development.yml
file by default. To use one of the other environments simply make a copy of development.yml
in the same directory and rename it to staging.yml
, test.yml
or production.yml
.