5 use Symfony\Component\DependencyInjection\ContainerAwareInterface;
6 use Symfony\Component\HttpKernel\HttpKernelInterface;
7 use Symfony\Component\HttpFoundation\Request;
10 * The interface for DrupalKernel, the core of Drupal.
12 * This interface extends Symfony's KernelInterface and adds methods for
13 * responding to modules being enabled or disabled during its lifetime.
15 interface DrupalKernelInterface extends HttpKernelInterface, ContainerAwareInterface {
18 * Event fired when the service container finished initializing in subrequest.
20 * This event allows you to initialize overrides such as language to the
25 const CONTAINER_INITIALIZE_SUBREQUEST_FINISHED = 'kernel.container.finish_container_initialize_subrequest';
28 * Boots the current kernel.
32 public function boot();
35 * Shuts down the kernel.
37 public function shutdown();
40 * Discovers available serviceProviders.
43 * The available serviceProviders.
45 public function discoverServiceProviders();
48 * Returns all registered service providers.
50 * @param string $origin
51 * The origin for which to return service providers; one of 'app' or 'site'.
54 * An associative array of ServiceProvider objects, keyed by name.
56 public function getServiceProviders($origin);
59 * Gets the current container.
61 * @return \Symfony\Component\DependencyInjection\ContainerInterface
62 * A ContainerInterface instance.
64 public function getContainer();
67 * Returns the cached container definition - if any.
69 * This also allows inspecting a built container for debugging purposes.
72 * The cached container definition or NULL if not found in cache.
74 public function getCachedContainerDefinition();
77 * Set the current site path.
80 * The current site path.
82 * @throws \LogicException
83 * In case the kernel is already booted.
85 public function setSitePath($path);
91 * The current site path.
93 public function getSitePath();
100 public function getAppRoot();
103 * Updates the kernel's list of modules to the new list.
105 * The kernel needs to update its bundle list and container to match the new
108 * @param array $module_list
109 * The new list of modules.
110 * @param array $module_filenames
111 * List of module filenames, keyed by module name.
113 public function updateModules(array $module_list, array $module_filenames = []);
116 * Force a container rebuild.
118 * @return \Symfony\Component\DependencyInjection\ContainerInterface
120 public function rebuildContainer();
123 * Invalidate the service container for the next request.
125 public function invalidateContainer();
128 * Prepare the kernel for handling a request without handling the request.
130 * @param \Symfony\Component\HttpFoundation\Request $request
131 * The current request.
135 * @deprecated in Drupal 8.0.x and will be removed before 9.0.0. Only used by
136 * legacy front-controller scripts.
138 public function prepareLegacyRequest(Request $request);
141 * Helper method that does request related initialization.
143 * @param \Symfony\Component\HttpFoundation\Request $request
144 * The current request.
146 public function preHandle(Request $request);
149 * Helper method that loads legacy Drupal include files.
151 public function loadLegacyIncludes();