FileAccess Orion

KernelInterface extends HttpKernelInterface

The Kernel is the heart of the Symfony system.

It manages an environment made of application kernel and bundles.

Tags
author

Fabien Potencier fabien@symfony.com

Table of Contents

MASTER_REQUEST  = 1
SUB_REQUEST  = 2
boot()  : mixed
Boots the current kernel.
getBundle()  : BundleInterface
Returns a bundle.
getBundles()  : array<string|int, BundleInterface>
Gets the registered bundle instances.
getCacheDir()  : string
Gets the cache directory.
getCharset()  : string
Gets the charset of the application.
getContainer()  : ContainerInterface
Gets the current container.
getEnvironment()  : string
Gets the environment.
getLogDir()  : string
Gets the log directory.
getName()  : string
Gets the name of the kernel.
getRootDir()  : string
Gets the application root dir (path of the project's Kernel class).
getStartTime()  : float
Gets the request start time (not available if debug is disabled).
handle()  : Response
Handles a Request to convert it to a Response.
isDebug()  : bool
Checks if debug mode is enabled.
locateResource()  : string|array<string|int, mixed>
Returns the file path for a given bundle resource.
registerBundles()  : iteratable<string|int, mixed>|array<string|int, BundleInterface>
Returns an array of bundles to register.
registerContainerConfiguration()  : mixed
Loads the container configuration.
shutdown()  : mixed
Shutdowns the kernel.

Constants

Methods

boot()

Boots the current kernel.

public boot() : mixed
Return values
mixed

getBundle()

Returns a bundle.

public getBundle(string $name) : BundleInterface
Parameters
$name : string

Bundle name

Tags
throws
InvalidArgumentException

when the bundle is not enabled

Return values
BundleInterface

A BundleInterface instance

getCacheDir()

Gets the cache directory.

public getCacheDir() : string
Return values
string

The cache directory

getCharset()

Gets the charset of the application.

public getCharset() : string
Return values
string

The charset

getEnvironment()

Gets the environment.

public getEnvironment() : string
Return values
string

The current environment

getLogDir()

Gets the log directory.

public getLogDir() : string
Return values
string

The log directory

getName()

Gets the name of the kernel.

public getName() : string
Tags
deprecated

since Symfony 4.2

Return values
string

The kernel name

getRootDir()

Gets the application root dir (path of the project's Kernel class).

public getRootDir() : string
Tags
deprecated

since Symfony 4.2

Return values
string

The Kernel root dir

getStartTime()

Gets the request start time (not available if debug is disabled).

public getStartTime() : float
Return values
float

The request start timestamp

handle()

Handles a Request to convert it to a Response.

public handle(Request $request[, int $type = self::MASTER_REQUEST ][, bool $catch = true ]) : Response

When $catch is true, the implementation must catch all exceptions and do its best to convert them to a Response instance.

Parameters
$request : Request
$type : int = self::MASTER_REQUEST

The type of the request (one of HttpKernelInterface::MASTER_REQUEST or HttpKernelInterface::SUB_REQUEST)

$catch : bool = true

Whether to catch exceptions or not

Tags
throws
Exception

When an Exception occurs during processing

Return values
Response

A Response instance

isDebug()

Checks if debug mode is enabled.

public isDebug() : bool
Return values
bool

true if debug mode is enabled, false otherwise

locateResource()

Returns the file path for a given bundle resource.

public locateResource(string $name) : string|array<string|int, mixed>

A Resource can be a file or a directory.

The resource name must follow the following pattern:

"@BundleName/path/to/a/file.something"

where BundleName is the name of the bundle and the remaining part is the relative path in the bundle.

Parameters
$name : string

A resource name to locate

Tags
throws
InvalidArgumentException

if the file cannot be found or the name is not valid

throws
RuntimeException

if the name contains invalid/unsafe characters

Return values
string|array<string|int, mixed>

The absolute path of the resource or an array if $first is false (array return value is deprecated)

registerBundles()

Returns an array of bundles to register.

public registerBundles() : iteratable<string|int, mixed>|array<string|int, BundleInterface>
Return values
iteratable<string|int, mixed>|array<string|int, BundleInterface>

An iterable of bundle instances

shutdown()

Shutdowns the kernel.

public shutdown() : mixed

This method is mainly useful when doing functional testing.

Return values
mixed

Search results