Skip to content
comhon-project edited this page Jul 1, 2019 · 14 revisions

Table of content

  1. Summary
  2. Example
  3. List

Summary

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.

Example

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"
  }
}

List

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.

manifestFormat

Define in wich format you have defined your Manifests and Serialization. Allowed format are json and xml (default json)

autoload

Define namespaces prefixes and path where Manifests and Serialization must be found. See Manifests and Serialization pages for more informations.

regexList

Define path where regex list file must be found. Actually you may define some regex to validate values (see pattern).

sqlTable

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.

sqlDatabase

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.

dateTimeFormat

Define default date time format to use when import/export datetimes values (default 'c' that is ISO 8601).

database

Define some informations to configure database connection :

  • charset
  • timezone

Clone this wiki locally