$config
$config : array<mixed,>
DI factory class creating a set of default services by loading them from a configuration file.
getConfig(string $key, string $default = null) : mixed
Helper function for reading values from the configuration and appy default values where configuration item is missing.
| string | $key | matching a key in the config array. |
| string | $default | value returned when config item is not found. |
or null if key does not exists.
get(string $service) : mixed
Finds an entry in the container by its identifier and returns it.
If the service is active/singelton then that instance is returned, else the service is loaded and a new instance is returned.
| string | $service | Identifier of the entry to look for. |
No entry was found for this identifier.
Error while retrieving the entry.
Entry.
has(string $service) : boolean
Returns true if the container can return an entry for the given identifier, otherwise false
has($id) returning true does not mean that get($id) will not
throw an exception.
It does however mean that get($id) will not throw a
NotFoundException.
| string | $service | Identifier of the entry to look for. |
set(string $service, mixed $loader) : void
Set a service and connect it to a task which creates the object (lazy loading).
| string | $service | as a service label, naming this service. |
| mixed | $loader | contains a pre-defined object, a string with class name or an callable which returns an instance of the service object. Its the way to actually load, insantiate, the service object. |
setShared(string $service, mixed $loader) : void
Set a singleton service and connect it to a task which creates the object (lazy loading).
| string | $service | as a service label, naming this service. |
| mixed | $loader | contains a pre-defined object, a string with class name or an callable which returns an instance of the service object. Its the way to actually load, insantiate, the service object. |