Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
bamarni opened this Issue · 5 comments

4 participants

@bamarni

Related to #6254.

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

@fabpot
Owner

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.

@bamarni

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.

@stof
Collaborator

@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.

@bamarni

@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.

@mpdude

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

@fabpot fabpot referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@fabpot fabpot referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@fabpot fabpot closed this in 2ff0927
@fabpot fabpot referenced this issue from a commit
@fabpot fabpot merged branch fabpot/debug-component (PR #7441)
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)
6d552c9
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.