-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
Comhon! allow you to set some configurations. They must be stored in a json file. By default Comhon! will search the file config.json in folder where you have launched your script.
But you may configure where configuration file must be searched. To do so, in your entrypoint script just add following lines :
use Comhon\Object\Config\Config;
// must be called before any Comhon functions
Config::setLoadPath('my/absolute/or/relative/path/to/my_config.json');Warning!! Configuration file is required and an exception will be thrown if file is not found.
Configuration file looks like :
{
"manifestFormat": "json",
"autoload": {
"manifest":{
"Test":"../manifests/manifest"
},
"serialization":{
"Test":"../manifests/serialization_pgsql"
}
},
"regexList":"./regex.json",
"sqlTable": "./table",
"sqlDatabase": "./database",
"dateTimeFormat": "c",
"database": {
"charset": "utf8",
"timezone": "UTC"
}
}We will explain one by one each available configurations. But before we have to explain configurations that describe a path. Each path may be absolute or relative. A path is considered as relative only if path begin with a . (or ..). A relative path is relative to configuration file.
Define in wich format you have defined your Manifests and Serialization.
Allowed format are json and xml (default json)
Define namespaces prefixes and path where Manifests and Serialization must be found. See Manifests and Serialization pages for more informations.
Define path where regex list file must be found. Actually you may define some regex to validate values (see pattern).
Define path to directory that contain all your sql tables informations. By default Comhon! will look into folder named table in folder where your script is launched.
Define path to directory that contain all your sql databases informations. By default Comhon! will look into folder named database in folder where your script is launched.
Define default date time format to use when import/export datetimes values (default c).
Define some informations to configure database connection :
- charset
- timezone