PHP Класс Symfony\Component\HttpKernel\Kernel

It manages an environment made of bundles.
Автор: Fabien Potencier ([email protected])
Наследование: implements Symfony\Component\HttpKernel\KernelInterface, implements Symfony\Component\HttpKernel\TerminableInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$booted
$bundleDirs
$bundleMap
$bundles
$classes
$container
$debug
$environment
$name
$rootDir
$startTime

Открытые методы

Метод Описание
__clone ( )
__construct ( string $environment, boolean $debug ) Constructor.
addClassesToCache ( array $classes )
boot ( ) Boots the current kernel.
getBundle ( string $name, boolean $first = true ) : Symfony\Component\HttpKernel\Bundle\BundleInterface | Array Returns a bundle and optionally its descendants by its name.
getBundleDirs ( ) : array Gets the directories where bundles can be stored.
getBundleForClass ( string $class ) : string Returns the Bundle name for a given class.
getBundles ( ) : array Gets the registered bundle names.
getCacheDir ( )
getCacheDir ( ) : string Gets the cache directory.
getContainer ( )
getContainer ( ) : Symfony\Component\DependencyInjection\ContainerInterface Gets the current container.
getEnvironment ( )
getEnvironment ( ) : string Gets the environment.
getKernelParameters ( )
getLogDir ( )
getLogDir ( ) : string Gets the log directory.
getName ( )
getName ( ) : string Gets the name of the kernel
getRootDir ( )
getRootDir ( ) : string Gets the application root dir.
getSafeName ( )
getStartTime ( )
getStartTime ( ) : integer Gets the request start time (not available if debug is disabled).
handle ( Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true )
init ( )
isBooted ( ) : boolean Checks whether the current kernel has been booted or not.
isClassInActiveBundle ( string $class ) : boolean Checks if a given class name belongs to an active bundle.
isDebug ( )
isDebug ( ) : boolean Checks if debug mode is enabled.
loadClassCache ( string $name = 'classes', string $extension = '.php' ) Loads the PHP class cache.
locateResource ( string $name, string $dir = null, boolean $first = true ) : string | array Returns the file path for a given resource.
reboot ( ) Reboots the kernel.
registerBundleDirs ( )
registerBundles ( )
registerContainerConfiguration ( Symfony\Component\DependencyInjection\Loader\LoaderInterface $loader )
registerRootDir ( )
serialize ( )
setClassCache ( array $classes ) Used internally.
shutdown ( ) Shutdowns the kernel.
stripComments ( string $source ) : string Removes comments from a PHP source string.
unserialize ( $data )

Защищенные методы

Метод Описание
buildContainer ( $class, $file )
buildContainer ( ) : ContainerBuilder Builds the service container.
dumpContainer ( Symfony\Component\Config\ConfigCache $cache, ContainerBuilder $container, string $class, string $baseClass ) Dumps the service container to PHP code in the cache.
getContainerBaseClass ( ) : string Gets the container's base class.
getContainerClass ( ) : string Gets the container class.
getContainerLoader ( Symfony\Component\DependencyInjection\ContainerInterface $container )
getContainerLoader ( Symfony\Component\DependencyInjection\ContainerInterface $container ) : Symfony\Component\Config\Loader\DelegatingLoader Returns a loader for the container.
getEnvParameters ( )
getEnvParameters ( ) : array Gets the environment parameters.
getHttpKernel ( ) : HttpKernel Gets a http kernel from the container
getKernelParameters ( ) : array Returns the kernel parameters.
initializeBundles ( ) Initializes the data structures related to the bundle management.
initializeContainer ( )
needsReload ( $class, $location )
writeCacheFile ( $file, $content )

Описание методов

__clone() публичный Метод

public __clone ( )

__construct() публичный Метод

Constructor.
public __construct ( string $environment, boolean $debug )
$environment string The environment
$debug boolean Whether to enable debugging or not

addClassesToCache() публичный Метод

public addClassesToCache ( array $classes )
$classes array

boot() публичный Метод

This method boots the bundles, which MUST set the DI container.
public boot ( )

buildContainer() защищенный Метод

protected buildContainer ( $class, $file )

buildContainer() защищенный Метод

Builds the service container.
protected buildContainer ( ) : ContainerBuilder
Результат Symfony\Component\DependencyInjection\ContainerBuilder The compiled service container

dumpContainer() защищенный Метод

Dumps the service container to PHP code in the cache.
protected dumpContainer ( Symfony\Component\Config\ConfigCache $cache, ContainerBuilder $container, string $class, string $baseClass )
$cache Symfony\Component\Config\ConfigCache The config cache
$container Symfony\Component\DependencyInjection\ContainerBuilder The service container
$class string The name of the class to generate
$baseClass string The name of the container's base class

getBundle() публичный Метод

Returns a bundle and optionally its descendants by its name.
public getBundle ( string $name, boolean $first = true ) : Symfony\Component\HttpKernel\Bundle\BundleInterface | Array
$name string Bundle name
$first boolean Whether to return the first bundle only or together with its descendants
Результат Symfony\Component\HttpKernel\Bundle\BundleInterface | Array A BundleInterface instance or an array of BundleInterface instances if $first is false

getBundleDirs() публичный Метод

Gets the directories where bundles can be stored.
public getBundleDirs ( ) : array
Результат array An array of directories where bundles can be stored

getBundleForClass() публичный Метод

Returns the Bundle name for a given class.
public getBundleForClass ( string $class ) : string
$class string A class name
Результат string The Bundle name or null if the class does not belongs to a bundle

getBundles() публичный Метод

Gets the registered bundle names.
public getBundles ( ) : array
Результат array An array of registered bundle names

getCacheDir() публичный Метод

public getCacheDir ( )

getCacheDir() публичный Метод

Gets the cache directory.
public getCacheDir ( ) : string
Результат string The cache directory

getContainer() публичный Метод

public getContainer ( )

getContainer() публичный Метод

Gets the current container.
public getContainer ( ) : Symfony\Component\DependencyInjection\ContainerInterface
Результат Symfony\Component\DependencyInjection\ContainerInterface A ContainerInterface instance

getContainerBaseClass() защищенный Метод

All names except Container must be fully qualified.
protected getContainerBaseClass ( ) : string
Результат string

getContainerClass() защищенный Метод

Gets the container class.
protected getContainerClass ( ) : string
Результат string The container class

getContainerLoader() защищенный Метод

protected getContainerLoader ( Symfony\Component\DependencyInjection\ContainerInterface $container )
$container Symfony\Component\DependencyInjection\ContainerInterface

getContainerLoader() защищенный Метод

Returns a loader for the container.
protected getContainerLoader ( Symfony\Component\DependencyInjection\ContainerInterface $container ) : Symfony\Component\Config\Loader\DelegatingLoader
$container Symfony\Component\DependencyInjection\ContainerInterface The service container
Результат Symfony\Component\Config\Loader\DelegatingLoader The loader

getEnvParameters() защищенный Метод

protected getEnvParameters ( )

getEnvParameters() защищенный Метод

Only the parameters starting with "SYMFONY__" are considered.
protected getEnvParameters ( ) : array
Результат array An array of parameters

getEnvironment() публичный Метод

public getEnvironment ( )

getEnvironment() публичный Метод

Gets the environment.
public getEnvironment ( ) : string
Результат string The current environment

getHttpKernel() защищенный Метод

Gets a http kernel from the container
protected getHttpKernel ( ) : HttpKernel
Результат HttpKernel

getKernelParameters() публичный Метод

public getKernelParameters ( )

getKernelParameters() защищенный Метод

Returns the kernel parameters.
protected getKernelParameters ( ) : array
Результат array An array of kernel parameters

getLogDir() публичный Метод

public getLogDir ( )

getLogDir() публичный Метод

Gets the log directory.
public getLogDir ( ) : string
Результат string The log directory

getName() публичный Метод

public getName ( )

getName() публичный Метод

Gets the name of the kernel
public getName ( ) : string
Результат string The kernel name

getRootDir() публичный Метод

public getRootDir ( )

getRootDir() публичный Метод

Gets the application root dir.
public getRootDir ( ) : string
Результат string The application root dir

getSafeName() публичный Метод

public getSafeName ( )

getStartTime() публичный Метод

public getStartTime ( )

getStartTime() публичный Метод

Gets the request start time (not available if debug is disabled).
public getStartTime ( ) : integer
Результат integer The request start timestamp

handle() публичный Метод

public handle ( Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true )
$request Symfony\Component\HttpFoundation\Request

init() публичный Метод

public init ( )

initializeBundles() защищенный Метод

- the bundles property maps a bundle name to the bundle instance, - the bundleMap property maps a bundle name to the bundle inheritance hierarchy (most derived bundle first).
protected initializeBundles ( )

initializeContainer() защищенный Метод

protected initializeContainer ( )

isBooted() публичный Метод

Checks whether the current kernel has been booted or not.
public isBooted ( ) : boolean
Результат boolean $booted

isClassInActiveBundle() публичный Метод

Checks if a given class name belongs to an active bundle.
public isClassInActiveBundle ( string $class ) : boolean
$class string A class name
Результат boolean true if the class belongs to an active bundle, false otherwise

isDebug() публичный Метод

public isDebug ( )

isDebug() публичный Метод

Checks if debug mode is enabled.
public isDebug ( ) : boolean
Результат boolean true if debug mode is enabled, false otherwise

loadClassCache() публичный Метод

Loads the PHP class cache.
public loadClassCache ( string $name = 'classes', string $extension = '.php' )
$name string The cache name prefix
$extension string File extension of the resulting file

locateResource() публичный Метод

A Resource can be a file or a directory. The resource name must follow the following pattern: @/path/to/a/file.something where BundleName is the name of the bundle and the remaining part is the relative path in the bundle. If $dir is passed, and the first segment of the path is "Resources", this method will look for a file named: $dir//path/without/Resources before looking in the bundle resource folder.
public locateResource ( string $name, string $dir = null, boolean $first = true ) : string | array
$name string A resource name to locate
$dir string A directory where to look for the resource first
$first boolean Whether to return the first path or paths for all matching bundles
Результат string | array The absolute path of the resource or an array if $first is false

needsReload() защищенный Метод

protected needsReload ( $class, $location )

reboot() публичный Метод

This method is mainly useful when doing functional testing. It is a shortcut for the call to shutdown() and boot().
public reboot ( )

registerBundleDirs() абстрактный публичный Метод

abstract public registerBundleDirs ( )

registerBundles() абстрактный публичный Метод

abstract public registerBundles ( )

registerContainerConfiguration() абстрактный публичный Метод

abstract public registerContainerConfiguration ( Symfony\Component\DependencyInjection\Loader\LoaderInterface $loader )
$loader Symfony\Component\DependencyInjection\Loader\LoaderInterface

registerRootDir() абстрактный публичный Метод

abstract public registerRootDir ( )

serialize() публичный Метод

public serialize ( )

setClassCache() публичный Метод

Used internally.
public setClassCache ( array $classes )
$classes array

shutdown() публичный Метод

This method is mainly useful when doing functional testing.
public shutdown ( )

stripComments() публичный статический Метод

We don't use the PHP php_strip_whitespace() function as we want the content to be readable and well-formatted.
public static stripComments ( string $source ) : string
$source string A PHP string
Результат string The PHP string with the comments removed

unserialize() публичный Метод

public unserialize ( $data )

writeCacheFile() защищенный Метод

protected writeCacheFile ( $file, $content )

Описание свойств

$booted защищенное свойство

protected $booted

$bundleDirs защищенное свойство

protected $bundleDirs

$bundleMap защищенное свойство

protected $bundleMap

$bundles защищенное свойство

protected $bundles

$classes защищенное свойство

protected $classes

$container защищенное свойство

protected $container

$debug защищенное свойство

protected $debug

$environment защищенное свойство

protected $environment

$name защищенное свойство

protected $name

$rootDir защищенное свойство

protected $rootDir

$startTime защищенное свойство

protected $startTime