interface DrupalKernelInterface

Same name in other branches
  1. 9 core/lib/Drupal/Core/DrupalKernelInterface.php \Drupal\Core\DrupalKernelInterface
  2. 8.9.x core/lib/Drupal/Core/DrupalKernelInterface.php \Drupal\Core\DrupalKernelInterface
  3. 11.x core/lib/Drupal/Core/DrupalKernelInterface.php \Drupal\Core\DrupalKernelInterface

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.

Hierarchy

  • interface \Drupal\Core\DrupalKernelInterface extends \Symfony\Component\HttpKernel\HttpKernelInterface \Symfony\Component\DependencyInjection\ContainerAwareInterface

Expanded class hierarchy of DrupalKernelInterface

All classes that implement DrupalKernelInterface

11 files declare their use of DrupalKernelInterface
AutowireTest.php in core/tests/Drupal/KernelTests/Core/DependencyInjection/AutowireTest.php
DevelopmentSettingsForm.php in core/modules/system/src/Form/DevelopmentSettingsForm.php
DrupalKernelTest.php in core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelTest.php
KernelPreHandle.php in core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php
LanguageRequestSubscriber.php in core/modules/language/src/EventSubscriber/LanguageRequestSubscriber.php

... See full list

File

core/lib/Drupal/Core/DrupalKernelInterface.php, line 16

Namespace

Drupal\Core
View source
interface DrupalKernelInterface extends HttpKernelInterface, ContainerAwareInterface {
    
    /**
     * Event fired when the service container finished initializing in subrequest.
     *
     * This event allows you to initialize overrides such as language to the
     * services.
     *
     * @var string
     */
    const CONTAINER_INITIALIZE_SUBREQUEST_FINISHED = 'kernel.container.finish_container_initialize_subrequest';
    
    /**
     * Boots the current kernel.
     *
     * @return $this
     */
    public function boot();
    
    /**
     * Shuts down the kernel.
     */
    public function shutdown();
    
    /**
     * Discovers available serviceProviders.
     *
     * @return array
     *   The available serviceProviders.
     */
    public function discoverServiceProviders();
    
    /**
     * Returns all registered service providers.
     *
     * @param string $origin
     *   The origin for which to return service providers; one of 'app' or 'site'.
     *
     * @return array
     *   An associative array of ServiceProvider objects, keyed by name.
     */
    public function getServiceProviders($origin);
    
    /**
     * Gets the current container.
     *
     * @return \Symfony\Component\DependencyInjection\ContainerInterface
     *   A ContainerInterface instance.
     */
    public function getContainer();
    
    /**
     * Returns the cached container definition - if any.
     *
     * This also allows inspecting a built container for debugging purposes.
     *
     * @return array|null
     *   The cached container definition or NULL if not found in cache.
     */
    public function getCachedContainerDefinition();
    
    /**
     * Set the current site path directory.
     *
     * Format: "folder-name/child-folder" usually uses "sites/default".
     *
     * @param string $path
     *   The current site path.
     *
     * @throws \LogicException
     *   In case the kernel is already booted.
     */
    public function setSitePath($path);
    
    /**
     * Gets the site path directory.
     *
     * @return string
     *   The current site path directory.
     */
    public function getSitePath();
    
    /**
     * Gets the app root.
     *
     * @return string
     */
    public function getAppRoot();
    
    /**
     * 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.
     *
     * @param array $module_list
     *   The new list of modules.
     * @param array $module_filenames
     *   List of module filenames, keyed by module name.
     */
    public function updateModules(array $module_list, array $module_filenames = []);
    
    /**
     * Force a container rebuild.
     *
     * @return \Symfony\Component\DependencyInjection\ContainerInterface
     */
    public function rebuildContainer();
    
    /**
     * Force a container reset.
     *
     * @return \Symfony\Component\DependencyInjection\ContainerInterface
     */
    public function resetContainer() : ContainerInterface;
    
    /**
     * Invalidate the service container for the next request.
     */
    public function invalidateContainer();
    
    /**
     * Helper method that does request related initialization.
     *
     * @param \Symfony\Component\HttpFoundation\Request $request
     *   The current request.
     */
    public function preHandle(Request $request);
    
    /**
     * Helper method that loads legacy Drupal include files.
     */
    public function loadLegacyIncludes();
    
    /**
     * Get a mapping from service hashes to service IDs.
     *
     * @deprecated in drupal:9.5.1 and is removed from drupal:11.0.0. Use the
     *   'Drupal\Component\DependencyInjection\ReverseContainer' service instead.
     *
     * @see https://www.drupal.org/node/3327942
     */
    public function getServiceIdMapping();

}

Members

Title Sort descending Deprecated Modifiers Object type Summary Overrides
DrupalKernelInterface::boot public function Boots the current kernel. 1
DrupalKernelInterface::CONTAINER_INITIALIZE_SUBREQUEST_FINISHED constant Event fired when the service container finished initializing in subrequest.
DrupalKernelInterface::discoverServiceProviders public function Discovers available serviceProviders. 1
DrupalKernelInterface::getAppRoot public function Gets the app root. 1
DrupalKernelInterface::getCachedContainerDefinition public function Returns the cached container definition - if any. 1
DrupalKernelInterface::getContainer public function Gets the current container. 1
DrupalKernelInterface::getServiceIdMapping Deprecated public function Get a mapping from service hashes to service IDs. 1
DrupalKernelInterface::getServiceProviders public function Returns all registered service providers. 1
DrupalKernelInterface::getSitePath public function Gets the site path directory. 1
DrupalKernelInterface::invalidateContainer public function Invalidate the service container for the next request. 1
DrupalKernelInterface::loadLegacyIncludes public function Helper method that loads legacy Drupal include files. 1
DrupalKernelInterface::preHandle public function Helper method that does request related initialization. 1
DrupalKernelInterface::rebuildContainer public function Force a container rebuild. 1
DrupalKernelInterface::resetContainer public function Force a container reset. 1
DrupalKernelInterface::setSitePath public function Set the current site path directory. 1
DrupalKernelInterface::shutdown public function Shuts down the kernel. 1
DrupalKernelInterface::updateModules public function Updates the kernel's list of modules to the new list. 1

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.