-
Notifications
You must be signed in to change notification settings - Fork 0
Environment
Many times you will want to have a development environment that is separate from your production environment. SECC makes it easy to separate your environments with a simple json configuration file.
The environment.json
should contain all of your environment specific information such as database credentials or email server information. It's located in the root of the framework directory and can be extended in anyway you see fit. To make a new configuration element you must create a new json object that will act as the parent of the configuration details that you wish to store. In the example provided there are some preset environment configurations, lets take a look at the hash settings. In the configuration file you will find an object named hash
... it looks like this...
"hash":
{
"algo": 1,
"cost": 10
},
The key is hash
and the settings are algo
and cost
with their respective values. To access these values you must make use of the config service. You can access configuration values with the following call to
Config::get()
App::service('Config')->get('name-of-config-element')
This works for any values that you wish to store in addition to the elements that have been provided for you.