KernelInterface (Component\HttpKernel)
Symfony\Component\HttpKernel\KernelInterface
interface KernelInterface implements HttpKernelInterface, Serializable
The Kernel is the heart of the Symfony system.
It manages an environment made of bundles.
Methods
Response | handle(Request $request, int $type = self::MASTER_REQUEST, bool $catch = true) Handles a Request to convert it to a Response. | from HttpKernelInterface |
BundleInterface[] | registerBundles() Returns an array of bundles to register. | |
registerContainerConfiguration(LoaderInterface $loader) Loads the container configuration. | ||
boot() Boots the current kernel. | ||
shutdown() Shutdowns the kernel. | ||
BundleInterface[] | getBundles() Gets the registered bundle instances. | |
BundleInterface|BundleInterface[] | getBundle(string $name, bool $first = true) Returns a bundle and optionally its descendants by its name. | |
string|array | locateResource(string $name, string $dir = null, bool $first = true) Returns the file path for a given resource. | |
string | getName() Gets the name of the kernel. | |
string | getEnvironment() Gets the environment. | |
bool | isDebug() Checks if debug mode is enabled. | |
string | getRootDir() Gets the application root dir. | |
ContainerInterface | getContainer() Gets the current container. | |
int | getStartTime() Gets the request start time (not available if debug is disabled). | |
string | getCacheDir() Gets the cache directory. | |
string | getLogDir() Gets the log directory. | |
string | getCharset() Gets the charset of the application. |
Details
public Response handle(Request $request, int $type = self::MASTER_REQUEST, bool $catch = true)
Handles a Request to convert it to a Response.
When $catch is true, the implementation must catch all exceptions and do its best to convert them to a Response instance.
public BundleInterface[] registerBundles()
Returns an array of bundles to register.
public registerContainerConfiguration(LoaderInterface $loader)
Loads the container configuration.
public boot()
Boots the current kernel.
public shutdown()
Shutdowns the kernel.
This method is mainly useful when doing functional testing.
public BundleInterface[] getBundles()
Gets the registered bundle instances.
public BundleInterface|BundleInterface[] getBundle(string $name, bool $first = true)
Returns a bundle and optionally its descendants by its name.
public string|array locateResource(string $name, string $dir = null, bool $first = true)
Returns the file path for a given resource.
A Resource can be a file or a directory.
The resource name must follow the following pattern:
"@BundleName/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/<BundleName>/path/without/Resources
before looking in the bundle resource folder.
public string getName()
Gets the name of the kernel.
public string getEnvironment()
Gets the environment.
public bool isDebug()
Checks if debug mode is enabled.
public string getRootDir()
Gets the application root dir.
public ContainerInterface getContainer()
Gets the current container.
public int getStartTime()
Gets the request start time (not available if debug is disabled).
public string getCacheDir()
Gets the cache directory.
public string getLogDir()
Gets the log directory.
public string getCharset()
Gets the charset of the application.
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.0/Symfony/Component/HttpKernel/KernelInterface.html