Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Closed
bamarni opened this issue Jan 22, 2013 · 5 comments

Comments

@bamarni
Copy link
Contributor

bamarni commented Jan 22, 2013

Related to #6254.

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

@fabpot
Copy link
Member

fabpot commented Feb 15, 2013

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
Copy link
Contributor Author

bamarni commented Feb 15, 2013

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
Copy link
Member

stof commented Feb 15, 2013

@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
Copy link
Contributor Author

bamarni commented Feb 15, 2013

@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
Copy link
Contributor

mpdude commented Mar 1, 2013

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

@fabpot fabpot closed this as completed in 2ff0927 Apr 7, 2013
fabpot added a commit that referenced this issue Apr 7, 2013
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants