final class Kernel (View source)

The one place a process is booted: index.php, dynamic_update.php, install/index.php and bin/poweradmin all call boot() and work from the BootContext it returns. Nothing below the entry points reaches for the configuration singleton.

Constants

private DEFAULT_CONFIGURATION_FILE

Methods

static BootContext
boot(BootOptions|bool $web)

Loads the configuration once, applies the timezone and session policy, builds the logger and the module registry, and opens the database when the entry point wants it up front.

controllerEnvironment(BootContext $context, bool $authenticate)

What a web controller needs beyond the booted context: the PHP extensions and the configuration file present, the gettext locale set, the database open and, unless the controller serves anonymous requests, the session authenticated. Runs once per controller; the checks are idempotent.

static PDO
connect(array $credentials)

Opens a PDO connection from mapped credentials (DatabaseCredentialMapper or the installer's form), wrapping failures in a readable message.

static string
configurationFile()

The settings file the process reads: PA_CONFIG_PATH when set, otherwise config/settings.php relative to the working directory.

Details

static BootContext boot(BootOptions|bool $web)

Loads the configuration once, applies the timezone and session policy, builds the logger and the module registry, and opens the database when the entry point wants it up front.

Parameters

BootOptions|bool $web

true boots as BootOptions::Web, false as BootOptions::Script

Return Value

BootContext

static ControllerEnvironment controllerEnvironment(BootContext $context, bool $authenticate)

What a web controller needs beyond the booted context: the PHP extensions and the configuration file present, the gettext locale set, the database open and, unless the controller serves anonymous requests, the session authenticated. Runs once per controller; the checks are idempotent.

Parameters

BootContext $context
bool $authenticate

Return Value

ControllerEnvironment

static PDO connect(array $credentials)

Opens a PDO connection from mapped credentials (DatabaseCredentialMapper or the installer's form), wrapping failures in a readable message.

Parameters

array $credentials

Return Value

PDO

static string configurationFile()

The settings file the process reads: PA_CONFIG_PATH when set, otherwise config/settings.php relative to the working directory.

Return Value

string