Documentation

Kernel
in package

FinalYes

Provides static methods to initialize the Dependency Injection container, initialize and register the app configuration as a service, uses the specifed logger to initialize the Log class, and to set the error handler to turn any error, warning, or notice into an exception.

Table of Contents

Constants

CLI_ID  : string = 'cli'

Methods

init()  : ContainerInterface
Initialize the LMWF.
initBare()  : ContainerInterface
Initialize only the container and only with the provided definitions.
initErrorHandler()  : void

Constants

CLI_ID

public string CLI_ID = 'cli'

Methods

init()

Initialize the LMWF.

public static init(string|null $confFolderPath[, array<string, mixed> $confData = [] ][, array<string, object> $containerDefinitions = [] ][, LoggerInterface|null $logger = null ]) : ContainerInterface

Initialize the app configuration (from the provided configuration data, from the provided path containing valid configuration files, or a mix of both), initialize the container (for dependency injection) and register the app configuration with it as well as any extra container definitions, initialize the Log class with the provided logger, and register a PHP error handler to turn any error, warning or notice into an exception.

Parameters
$confFolderPath : string|null

The path to the folder containing the app configuration files, null if all the configuration is provided with $confData.

$confData : array<string, mixed> = []

An array of configuration data to initialize the configuration, to complement the configuration read from a file or replace it if no path was specified.

$containerDefinitions : array<string, object> = []
$logger : LoggerInterface|null = null

A logger to initialize the Log class with.

Return values
ContainerInterface

initBare()

Initialize only the container and only with the provided definitions.

public static initBare(array<string, object> $containerDefinitions) : ContainerInterface

The Log class is not initialized nor is the PHP error handler set.

Parameters
$containerDefinitions : array<string, object>
Return values
ContainerInterface

initErrorHandler()

private static initErrorHandler() : void
On this page

Search results