AppKernel
extends Kernel
in package
The Kernel is the heart of the Symfony system.
It manages an environment made of bundles.
Environment names must always start with a letter and they must only contain letters and numbers.
Table of Contents
Constants
- END_OF_LIFE = '01/2023'
- END_OF_MAINTENANCE = '01/2023'
- EXTRA_VERSION = ''
- MAJOR_VERSION = 6
- MINOR_VERSION = 0
- RELEASE_VERSION = 20
- VERSION = '6.0.20'
- VERSION_ID = 60020
Properties
- $booted : mixed
- $bundles : array<string, BundleInterface>
- $container : mixed
- $debug : mixed
- $environment : mixed
- $startTime : mixed
- $freshCache : array<string, bool>
- $projectDir : string
- $requestStackSize : int
- $resetServices : bool
- $warmupDir : string|null
Methods
- __clone() : mixed
- __construct() : mixed
- __sleep() : array<string|int, mixed>
- __wakeup() : mixed
- boot() : mixed
- Boots the current kernel.
- getAnnotatedClassesToCompile() : array<string|int, mixed>
- Gets the patterns defining the classes to parse and cache for annotations.
- getBuildDir() : string
- Returns the build directory.
- getBundle() : BundleInterface
- Returns a bundle.
- getBundles() : array<string, BundleInterface>
- Gets the registered bundle instances.
- getCacheDir() : mixed
- Gets the cache directory.
- getCharset() : string
- Gets the charset of the application.
- getContainer() : ContainerInterface
- Gets the current container.
- getEnvironment() : string
- Gets the environment.
- getLogDir() : mixed
- Gets the log directory.
- getProjectDir() : string
- Gets the application root dir (path of the project's composer file).
- getRootDir() : mixed
- getStartTime() : float
- Gets the request start time (not available if debug is disabled).
- handle() : Response
- {@inheritdoc}
- isDebug() : bool
- Checks if debug mode is enabled.
- locateResource() : string
- Returns the file path for a given bundle resource.
- reboot() : mixed
- Reboots a kernel.
- registerBundles() : mixed
- registerContainerConfiguration() : mixed
- shutdown() : mixed
- Shutdowns the kernel.
- stripComments() : string
- Removes comments from a PHP source string.
- terminate() : mixed
- Terminates a request/response cycle.
- build() : mixed
- The extension point similar to the Bundle::build() method.
- buildContainer() : ContainerBuilder
- Builds the service container.
- dumpContainer() : mixed
- Dumps the service container to PHP code in the cache.
- getContainerBaseClass() : string
- Gets the container's base class.
- getContainerBuilder() : ContainerBuilder
- Gets a new ContainerBuilder instance used to build the service container.
- getContainerClass() : string
- Gets the container class.
- getContainerLoader() : DelegatingLoader
- Returns a loader for the container.
- getHttpKernel() : HttpKernelInterface
- Gets an HTTP kernel from the container.
- getKernelParameters() : array<string|int, mixed>
- Returns the kernel parameters.
- initializeBundles() : mixed
- Initializes bundles.
- initializeContainer() : mixed
- Initializes the service container.
- prepareContainer() : mixed
- Prepares the ContainerBuilder before it is compiled.
- preBoot() : ContainerInterface
Constants
END_OF_LIFE
public
mixed
END_OF_LIFE
= '01/2023'
END_OF_MAINTENANCE
public
mixed
END_OF_MAINTENANCE
= '01/2023'
EXTRA_VERSION
public
mixed
EXTRA_VERSION
= ''
MAJOR_VERSION
public
mixed
MAJOR_VERSION
= 6
MINOR_VERSION
public
mixed
MINOR_VERSION
= 0
RELEASE_VERSION
public
mixed
RELEASE_VERSION
= 20
VERSION
public
mixed
VERSION
= '6.0.20'
VERSION_ID
public
mixed
VERSION_ID
= 60020
Properties
$booted
protected
mixed
$booted
= false
$bundles
protected
array<string, BundleInterface>
$bundles
= []
$container
protected
mixed
$container
$debug
protected
mixed
$debug
$environment
protected
mixed
$environment
$startTime
protected
mixed
$startTime
$freshCache
private
static array<string, bool>
$freshCache
= []
$projectDir
private
string
$projectDir
$requestStackSize
private
int
$requestStackSize
= 0
$resetServices
private
bool
$resetServices
= false
$warmupDir
private
string|null
$warmupDir
= null
Methods
__clone()
public
__clone() : mixed
__construct()
public
__construct(string $environment, bool $debug) : mixed
Parameters
- $environment : string
- $debug : bool
__sleep()
public
__sleep() : array<string|int, mixed>
Return values
array<string|int, mixed>__wakeup()
public
__wakeup() : mixed
boot()
Boots the current kernel.
public
boot() : mixed
getAnnotatedClassesToCompile()
Gets the patterns defining the classes to parse and cache for annotations.
public
getAnnotatedClassesToCompile() : array<string|int, mixed>
Return values
array<string|int, mixed>getBuildDir()
Returns the build directory.
public
getBuildDir() : string
Return values
stringgetBundle()
Returns a bundle.
public
getBundle(string $name) : BundleInterface
Parameters
- $name : string
Return values
BundleInterfacegetBundles()
Gets the registered bundle instances.
public
getBundles() : array<string, BundleInterface>
Return values
array<string, BundleInterface>getCacheDir()
Gets the cache directory.
public
getCacheDir() : mixed
getCharset()
Gets the charset of the application.
public
getCharset() : string
Return values
stringgetContainer()
Gets the current container.
public
getContainer() : ContainerInterface
Return values
ContainerInterfacegetEnvironment()
Gets the environment.
public
getEnvironment() : string
Return values
stringgetLogDir()
Gets the log directory.
public
getLogDir() : mixed
getProjectDir()
Gets the application root dir (path of the project's composer file).
public
getProjectDir() : string
Return values
stringgetRootDir()
public
getRootDir() : mixed
getStartTime()
Gets the request start time (not available if debug is disabled).
public
getStartTime() : float
Return values
floathandle()
{@inheritdoc}
public
handle(Request $request[, int $type = HttpKernelInterface::MAIN_REQUEST ][, bool $catch = true ]) : Response
Parameters
- $request : Request
- $type : int = HttpKernelInterface::MAIN_REQUEST
- $catch : bool = true
Return values
ResponseisDebug()
Checks if debug mode is enabled.
public
isDebug() : bool
Return values
boollocateResource()
Returns the file path for a given bundle resource.
public
locateResource(string $name) : string
Parameters
- $name : string
Return values
stringreboot()
Reboots a kernel.
public
reboot(string|null $warmupDir) : mixed
Parameters
- $warmupDir : string|null
-
pass null to reboot in the regular build directory
registerBundles()
public
registerBundles() : mixed
registerContainerConfiguration()
public
registerContainerConfiguration(LoaderInterface $loader) : mixed
Parameters
- $loader : LoaderInterface
shutdown()
Shutdowns the kernel.
public
shutdown() : mixed
stripComments()
Removes comments from a PHP source string.
public
static stripComments(string $source) : string
We don't use the PHP php_strip_whitespace() function as we want the content to be readable and well-formatted.
Parameters
- $source : string
Return values
stringterminate()
Terminates a request/response cycle.
public
terminate(Request $request, Response $response) : mixed
Parameters
build()
The extension point similar to the Bundle::build() method.
protected
build(ContainerBuilder $container) : mixed
Use this method to register compiler passes and manipulate the container during the building process.
Parameters
- $container : ContainerBuilder
buildContainer()
Builds the service container.
protected
buildContainer() : ContainerBuilder
Tags
Return values
ContainerBuilderdumpContainer()
Dumps the service container to PHP code in the cache.
protected
dumpContainer(ConfigCache $cache, ContainerBuilder $container, string $class, string $baseClass) : mixed
Parameters
- $cache : ConfigCache
- $container : ContainerBuilder
- $class : string
-
The name of the class to generate
- $baseClass : string
-
The name of the container's base class
getContainerBaseClass()
Gets the container's base class.
protected
getContainerBaseClass() : string
All names except Container must be fully qualified.
Return values
stringgetContainerBuilder()
Gets a new ContainerBuilder instance used to build the service container.
protected
getContainerBuilder() : ContainerBuilder
Return values
ContainerBuildergetContainerClass()
Gets the container class.
protected
getContainerClass() : string
Tags
Return values
stringgetContainerLoader()
Returns a loader for the container.
protected
getContainerLoader(ContainerInterface $container) : DelegatingLoader
Parameters
- $container : ContainerInterface
Return values
DelegatingLoadergetHttpKernel()
Gets an HTTP kernel from the container.
protected
getHttpKernel() : HttpKernelInterface
Return values
HttpKernelInterfacegetKernelParameters()
Returns the kernel parameters.
protected
getKernelParameters() : array<string|int, mixed>
Return values
array<string|int, mixed>initializeBundles()
Initializes bundles.
protected
initializeBundles() : mixed
Tags
initializeContainer()
Initializes the service container.
protected
initializeContainer() : mixed
The built version of the service container is used when fresh, otherwise the container is built.
prepareContainer()
Prepares the ContainerBuilder before it is compiled.
protected
prepareContainer(ContainerBuilder $container) : mixed
Parameters
- $container : ContainerBuilder
preBoot()
private
preBoot() : ContainerInterface