interface DrupalKernelInterface implements HttpKernelInterface, ContainerAwareInterface (View source)

The interface for DrupalKernel, the core of Drupal.

This interface extends Symfony's KernelInterface and adds methods for responding to modules being enabled or disabled during its lifetime.

Constants

CONTAINER_INITIALIZE_SUBREQUEST_FINISHED

Event fired when the service container finished initializing in subrequest.

This event allows you to initialize overrides such as language to the services.

Methods

$this
boot()

Boots the current kernel.

shutdown()

Shuts down the kernel.

array
discoverServiceProviders()

Discovers available serviceProviders.

array
getServiceProviders(string $origin)

Returns all registered service providers.

ContainerInterface
getContainer()

Gets the current container.

array|null
getCachedContainerDefinition()

Returns the cached container definition - if any.

setSitePath(string $path)

Set the current site path.

string
getSitePath()

Get the site path.

string
getAppRoot()

Gets the app root.

updateModules(array $module_list, array $module_filenames = [])

Updates the kernel's list of modules to the new list.

ContainerInterface
rebuildContainer()

Force a container rebuild.

invalidateContainer()

Invalidate the service container for the next request.

preHandle(Request $request)

Helper method that does request related initialization.

loadLegacyIncludes()

Helper method that loads legacy Drupal include files.

Details

$this boot()

Boots the current kernel.

Return Value

$this

shutdown()

Shuts down the kernel.

array discoverServiceProviders()

Discovers available serviceProviders.

Return Value

array

The available serviceProviders.

array getServiceProviders(string $origin)

Returns all registered service providers.

Parameters

string $origin

The origin for which to return service providers; one of 'app' or 'site'.

Return Value

array

An associative array of ServiceProvider objects, keyed by name.

ContainerInterface getContainer()

Gets the current container.

Return Value

ContainerInterface

A ContainerInterface instance.

array|null getCachedContainerDefinition()

Returns the cached container definition - if any.

This also allows inspecting a built container for debugging purposes.

Return Value

array|null

The cached container definition or NULL if not found in cache.

setSitePath(string $path)

Set the current site path.

Parameters

string $path

The current site path.

Exceptions

LogicException

string getSitePath()

Get the site path.

Return Value

string

The current site path.

string getAppRoot()

Gets the app root.

Return Value

string

updateModules(array $module_list, array $module_filenames = [])

Updates the kernel's list of modules to the new list.

The kernel needs to update its bundle list and container to match the new list.

Parameters

array $module_list

The new list of modules.

array $module_filenames

List of module filenames, keyed by module name.

ContainerInterface rebuildContainer()

Force a container rebuild.

Return Value

ContainerInterface

invalidateContainer()

Invalidate the service container for the next request.

preHandle(Request $request)

Helper method that does request related initialization.

Parameters

Request $request

The current request.

loadLegacyIncludes()

Helper method that loads legacy Drupal include files.