Skip to content


In debug mode, the ```Kernel::init()``` method is incompatible with ```Kernel:unserialize()``` #6834

bamarni opened this Issue · 5 comments

4 participants


Related to #6254.

What about a static flag on it so that it gets intialized only once in a process?

Symfony member

I think that the Kernel::init() method should be removed altogether and the code moved to the front controllers (like is done in fabpot/Silex-Skeleton). I will do that for 2.3.

It is also related to #6828 as it will allow for a better decoupling.


imo the method shouldn't be removed , only its call being moved:

// ...
$kernel = new AppKernel('dev', true);
// ...

About the decoupling between Debug and HttpKernel, I don't think removing this method would add any value, while the yet-to-come Debug component wouldn't be tied to the Kernel, the opposite isn't true apparently, if we just look at the constructor's second argument.

Symfony member

@bamarni the debug mode of the kernel is about controlling whether the cache should be reloaded automatically, and such other things. Registering an error handler and an exception handler in dev is better done by the front controller than the kernel IMO.


@stof : The debug mode of the kernel is also about controlling what we're currently considering to move (, I don't think it is related to the dev environment, currently all those things are registered when I switch debug to true in my prod front controller too.


Does it make sense at all for the kernel to be serialized?

@fabpot fabpot closed this in 2ff0927
@fabpot fabpot added a commit that referenced this issue
@fabpot fabpot merged branch fabpot/debug-component (PR #7441)
This PR was merged into the master branch.


[Debug] added the component (closes #6828, closes #6834, closes #7330)

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #6828, #6834, #7330
| License       | MIT
| Doc PR        | symfony/symfony-docs#2479

You can use the individual tools, or register them all:

use Symfony\Component\Debug\Debug;


Changes in Symfony SE: symfony/symfony-standard#523


f693128 fixed typos
1ab1146 [Debug] fixed minor bugs
daa3a3c [Debug] changed composer to accept more versions
e455269 [Debug] ensured that the Debug tools can only be registered once
946bfb2 [Debug] made the exception handler independant of HttpFoundation
2b305c2 added a main Debug class to ease integration
2ff0927 [Debug] added the component (closes #6828, closes #6834, closes #7330)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.