Graph-IT

services.json

The services.json specifies services which are available to the controller and global data for those services.

Services

Each service declaration consists of at least three infos.

"< servicename >": {
  "type": "service",
  "< source >",
}

Given these three infos, the service is then available through $this->get('< servicename >') inside a [Controller](graphit/giwt/Controller.md).

Additionally to the three mandatory infos one can specify:

args

Arguments for the method can be specified in tree different ways:

config

"config": [
  { "method": "< methodname >",
    "args": [
      { "type": "service", "name": "< value name >" },
      { "type": "value", "value": "< value name >" },
      { "value": < value > },
    ]
  }
]

Each method that should be called needs to be specified by the name of the method to call (< methodname >) and potentially an array of arguments.

args

Same as above.

Global

Aside from the services there are also a few already used parameters that can be set through the services.json.

Any additional parameters that are used in the source code should be set accordingly inside the services.json.