-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
In debug mode, the Kernel::init()
method is incompatible with Kernel:unserialize()
#6834
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
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: <?php
// ...
$kernel = new AppKernel('dev', true);
$kernel->init();
$kernel->loadClassCache();
// ... 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. |
@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 (https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/Kernel.php#L101), 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? |
This PR was merged into the master branch. Discussion ---------- [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: ```php use Symfony\Component\Debug\Debug; Debug::enable(); ``` Changes in Symfony SE: symfony/symfony-standard#523 Commits ------- 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)
Related to #6254.
What about a static flag on it so that it gets intialized only once in a process?
The text was updated successfully, but these errors were encountered: