Commit Graph

7532 Commits

Author SHA1 Message Date
Fabien Potencier
5a549f2be7 merged branch stof/profiler_priority (PR #2439)
Commits
-------

e81c710 Increased the priority of the profiler request listener

Discussion
----------

Increased the priority of the profiler request listener

If a request listener returns a response before calling the profiler
listener, the request will not be added in the stack leading to an error
during the handling of the kernel.response event. The profiler listener
should ideally be run first.

The same issue will occur if a previous listener throws an exception btw.

---------------------------------------------------------------------------

by schmittjoh at 2011/10/20 08:21:15 -0700

Can you add a test?

These interdependencies between listeners are really easy to mess up, and no-one will remember why listener X has to be run before listener Y, but after listener Z.

---------------------------------------------------------------------------

by stof at 2011/10/20 08:27:51 -0700

Well, in fact, the only rule is that the listener **must** run for the request event to avoid failing during the response event of an eventual subrequest. So if another listener triggers a subrequest before the profiler is called, it will fail because the parent request is not in the stack.

A better fix would probably make the listener work even when the propagation of the request event has been stopped (or has not reached this listener yet) to avoid issues (someone doing a subrequest in its own listener will still be able to use a higher priority for instance) but I don't have time to refactor @fabpot's refactoring now.

---------------------------------------------------------------------------

by schmittjoh at 2011/10/20 08:36:40 -0700

Another idea would be to add a ProfilerHttpKernel as it basically needs to wrap the request/response cycle, and people might have priorities beyond 1000 (see @Seldaek's SecurityBundle).

Using an extra kernel would be the only way to really guarantee that it is working. Note that I'm not implying you should do it, but as a "real" fix this would probably be better.

---------------------------------------------------------------------------

by stof at 2011/10/20 08:43:07 -0700

The issue by wrapping the HttpKernel is that the kernel passed in the event is the one dispatching the event. So we would have to implement it by using inheritance, not composition (otherwise the listener would create subrequests using the inner kernel and they would not be profiled).
But FrameworkBundle already extend the HttpKernel to handle the creation of the request scope (which must be done using inheritance for the same reason).
So it would require having a ContainerAwareHttpKernel (handling the scope), a ProfilerHttpKernel (handling the profiler) both extending the base HttpKernel (the Profiler one should be usable when using only the component, and the ContainerAware one is needed in prod when disabling the profiler) but also a ContainerAwareProfilerHttpKernel extending one of them and duplicating the logic of the other.

---------------------------------------------------------------------------

by schmittjoh at 2011/10/20 08:52:13 -0700

So maybe, we need to revisit which kernel is passed in the event as well.

But doing things more explicitly is better than making assumptions about priorities that no-one can remember in a few weeks.

---------------------------------------------------------------------------

by stof at 2011/10/20 09:53:45 -0700

@schmittjoh Issue is, using composition would require to let the inner kernel know about the wrapper to be able to pass it in the event. This looks ugly.

But I agree it would be better to do things explicitly

---------------------------------------------------------------------------

by Seldaek at 2011/10/21 07:39:23 -0700

Didn't read everything, busy, but regarding the mention of our security bundle, it is highlighting a big issue with priorities imo, in that we're missing a one-stop page that lists all the existing priorities, and possibly some more details like "if you do this, don't go above this priority or it'll blow up". Otherwise it'll just be a game of escalation :)
2011-10-23 09:50:26 +02:00
Fabien Potencier
d5bec5a57c merged branch mvrhov/cache_warmup_exception (PR #2445)
Commits
-------

6b872cf Check if cache_warmer service is available before doing the actual cache warmup
40fb76d [Framework] removed wrong listener

Discussion
----------

fix cache warump exception when service is not available

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: N/A

fixes [Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
  You have requested a non-existent service "cache_warmer". in console when FrameworkBundle is removed from kernel.
2011-10-23 09:48:57 +02:00
Fabien Potencier
559d676b39 merged branch snc/upgrade-session-locale (PR #2446)
Commits
-------

c915f48 Added another "before" possibility to retrieve the locale from a Twig template.

Discussion
----------

Added {{ app.session.locale }} to UPGRADE-2.1.md

Added another "before" possibility to retrieve the locale from a Twig template.
2011-10-23 09:47:55 +02:00
Fabien Potencier
ad7fcf5206 moved WarmableInterface to the HttpKernel component 2011-10-23 09:47:17 +02:00
Fabien Potencier
cb9ac138d5 merged branch dbu/router-cache-warmup-interface (PR #2451)
Commits
-------

96235a6 cs fix
46a69f1 define a WarmableInterface and only warm the cache if it implements warmable to allow replacing the core router. this fixes #2422. combining routers will only really work when #2450 is merged too.

Discussion
----------

define a WarmableInterface and only warm the cache if it implements warmable

define a WarmableInterface and only warm the cache if it implements warmable to allow replacing the core router. this fixes #2422. combining routers will only really work when #2450 is merged too.

Bug fix: yes
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes*
Fixes the following tickets: #2422

(*) tests:
success for
phpunit src/Symfony/Bundle/FrameworkBundle/Tests/
and
phpunit tests/Symfony/Tests/Component/Routing/

but when running all tests, i have to put gc_disable() into autoload to avoid segmentation fault and then get (after 3000 successful tests):

PHP Fatal error:  Call to undefined method Symfony\Tests\Component\HttpKernel\Debug\StopwatchTest::assertCount() in /home/david/liip/symfony-cmf/cmf-sandbox/vendor/symfony/tests/Symfony/Tests/Component/HttpKernel/Debug/StopwatchTest.php on line 84

---------------------------------------------------------------------------

by stof at 2011/10/22 08:46:31 -0700

@dbu assertCount is new in PHP 3.6. It seems like the test of the new 2.1 feature has been written using 3.6-RC.

---------------------------------------------------------------------------

by dbu at 2011/10/22 09:40:07 -0700

@stof: ah, thanks for the hint. i hope you mean php 3.4 and not 3.6? but i assume symfony 2.1 should be able to run on 3.3, right?

anyways, the tests run through if i disable the StopWatch, so i guess we can consider the tests succeeding.

---------------------------------------------------------------------------

by stof at 2011/10/22 09:41:28 -0700

this is a method of PHPUnit TestCase class. I was talking about the PHPUnit version
2011-10-23 09:43:17 +02:00
Fabien Potencier
3134ef132a [HttpKernel] removed usage of assertCount which has been introduced in PHPUnit 3.6 2011-10-23 09:41:19 +02:00
Fabien Potencier
b995023bd2 merged branch Seldaek/composerjson (PR #2447)
Commits
-------

c89bccb Replace 2.1.* and not any version above 2.1

Discussion
----------

Replace 2.1.* and not any version above 2.1
2011-10-23 09:38:58 +02:00
Fabien Potencier
6cacc63ba9 merged branch dbu/fix-router-dependency-injection (PR #2450)
Commits
-------

6b02ffb fix a typo in the routing dependency injection configuration. the request_context service is named router, not routing

Discussion
----------

fix a typo in the routing dependency injection configuration

fix a typo in the routing dependency injection configuration. the request_context service is named router.request_context , not routing.request_context

Bug fix: yes
Feature addition: no
Backwards compatibility break: ? - should not unless somebody relied on the bug
Symfony2 tests pass: yes
Fixes the following tickets: no ticket

i ran
phpunit src/Symfony/Bundle/FrameworkBundle/Tests/
and
phpunit tests/Symfony/Tests/Component/Routing/
2011-10-23 09:37:26 +02:00
dbu
96235a6847 cs fix 2011-10-22 16:27:21 +02:00
dbu
46a69f1ca0 define a WarmableInterface and only warm the cache if it implements warmable to allow replacing the core router. this fixes #2422. combining routers will only really work when #2450 is merged too. 2011-10-22 16:12:46 +02:00
dbu
6b02ffba0f fix a typo in the routing dependency injection configuration. the request_context service is named router, not routing 2011-10-22 16:07:33 +02:00
Jordi Boggiano
c89bccbc2d Replace 2.1.* and not any version above 2.1 2011-10-22 12:08:38 +02:00
H. Westphal
c915f4851f Added another "before" possibility to retrieve the locale from a Twig template. 2011-10-22 11:23:43 +02:00
Miha Vrhovnik
6b872cfa40 Check if cache_warmer service is available before doing the actual cache warmup 2011-10-22 10:56:16 +02:00
Fabien Potencier
490d60f5f9 [HttpKernel] fixed event priority (if not, there is a problem when an exception occurs during one of the event registered before this one) 2011-10-22 09:30:41 +02:00
Fabien Potencier
d3361c17e5 Revert "[Framework] removed wrong listener"
This reverts commit 40fb76dd1a.
2011-10-22 08:54:39 +02:00
Fabien Potencier
c5ca40c711 [Routing] added support for _scheme requirement in UrlMatcher (see 07aae98495) 2011-10-22 08:04:10 +02:00
Fabien Potencier
b95fe53bf4 - 2011-10-21 16:46:37 +02:00
Fabien Potencier
842ac36f33 added Stopwatch support in debug mode, added a timeline representing the stopwatch events in the web profiler
Enjoy!
2011-10-21 07:45:12 +02:00
Fabien Potencier
106ebdbe18 [HttpKernel] added a Stopwatch 2011-10-21 07:39:32 +02:00
Fabien Potencier
fbc422b978 [BrowserKit] added the standard output when an error occurs during the request execution (it might contain very useful information for debugging) 2011-10-21 07:39:26 +02:00
Fabien Potencier
40fb76dd1a [Framework] removed wrong listener 2011-10-20 22:59:10 +02:00
Christophe Coevoet
e81c710784 Increased the priority of the profiler request listener
If a request listener returns a response before calling the profiler
listener, the request will not be added in the stack leading to an error
during the handling of the kernel.response event. The profiler listener
should ideally be run first.
2011-10-20 16:48:14 +02:00
docteurklein
78883f90a6 Allow syntax like `{% render "AcmeDemoBundle:Frontend/Default:index" %}`
Bug fix: yes
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2424
2011-10-18 16:38:10 +02:00
Fabien Potencier
da507f15f0 merged branch richardmiller/adding_info_to_container_debug (PR #2426)
Commits
-------

79638d3 Removed abstract as these services will not appear anyway
312b20f [FrameworkBundle] Added more info to debug command output

Discussion
----------

[FrameworkBundle] Added more info to debug command output

---------------------------------------------------------------------------

by stof at 2011/10/18 05:57:59 -0700

This commands uses the optimized container so abstract services will never appear there.
2011-10-18 15:24:56 +02:00
Richard Miller
79638d3734 Removed abstract as these services will not appear anyway 2011-10-18 14:02:24 +01:00
Richard Miller
312b20f94b [FrameworkBundle] Added more info to debug command output 2011-10-18 13:54:39 +01:00
Fabien Potencier
347053c363 Moved most of the logic from ResponseListener to the Response::prepare() method
That allows projects that only use HttpFoundation and not HttpKernel to be able to
enforce the HTTP specification "rules".

$request = Request::createFromGlobals();
$response = new Response();

// do whatever you want with the Respons

// enforce HTTP spec
$response->prepare($request);

$response->send();

Within Symfony2, the prepare method is automatically called by the ResponseListener.
2011-10-18 09:04:20 +02:00
Fabien Potencier
fbbda262e7 merged 2.0 2011-10-17 21:41:08 +02:00
Fabien Potencier
8ca19af477 merged branch Tobion/patch-3 (PR #2415)
Commits
-------

ae342c7 unified toolbar.css
a7e4e70 unified profiler.css
09fe09e unified and corrected exception_layout.css
3a1674b unified and corrected exception.css

Discussion
----------

Unified and corrected CSS markup

Unified (spaces, braces, quotes, indention) and corrected (missing semicolon) the CSS markup.
Did not change any semantic, only markup!
@fabpot: New pull based on symfony:2.0 and changed formatting style as agreed in #2405
2011-10-17 21:38:01 +02:00
Fabien Potencier
fcd533a541 merged branch richardmiller/fixing_debug_command_output (PR #2420)
Commits
-------

1768544 Changed debug output to say Service Id rather than name for the service ids

Discussion
----------

Changed debug output to say Service Id rather than name for the service i

Changed debug output to say Service Id rather than name for the service ids
2011-10-17 21:29:09 +02:00
Fabien Potencier
97d6591985 [WebProfilerBundle] tweaked the default layout to make more room for interesting content 2011-10-17 16:01:42 +02:00
Richard Miller
1768544710 Changed debug output to say Service Id rather than name for the service ids 2011-10-17 14:03:16 +01:00
IamPersistent
fbd2a0ed9a make suggested changes for default value 2011-10-17 03:27:04 -07:00
IamPersistent
c507b1db73 update variable name to match the option name 2011-10-17 02:58:01 -07:00
IamPersistent
b53f000061 add the ability to set the form prototype name in CollectionType. this will aid in handling nested collections in forms 2011-10-17 02:43:24 -07:00
Fabien Potencier
0ffd91724b Merge branch '2.0'
* 2.0:
  [HttpKernel] fixed typo
2011-10-17 04:18:59 +02:00
Fabien Potencier
c6e9011fb5 [HttpKernel] fixed typo 2011-10-17 04:18:47 +02:00
Fabien Potencier
de9cf88676 merged 2.0 2011-10-17 02:33:13 +02:00
Fabien Potencier
2b0af5e93b [HttpKernel] fixed profile parent/children for deep-nested requests 2011-10-17 02:32:06 +02:00
Tobias Schultze
ae342c7484 unified toolbar.css 2011-10-17 00:16:29 +03:00
Tobias Schultze
a7e4e70890 unified profiler.css 2011-10-17 00:14:43 +03:00
Tobias Schultze
09fe09ef5a unified and corrected exception_layout.css 2011-10-16 23:58:22 +03:00
Tobias Schultze
3a1674bcd4 unified and corrected exception.css 2011-10-16 23:50:00 +03:00
Fabien Potencier
360053d95a [DoctrineBridge] fixed a unit test 2011-10-16 22:45:12 +02:00
Fabien Potencier
373e146b6a [DoctrineBundle] fixed PHPDoc 2011-10-16 22:42:14 +02:00
Fabien Potencier
b8360d83f0 merged branch stof/doctrine_registry (PR #2410)
Commits
-------

9546ee6 Removed the IndexedReader
ea2cf73 Refactored the validator initializer
c6063ec [DoctrineBundle] Updated the code to use the new registry
a1784c2 [DoctrineBridge] Updated the code to use the new registry

Discussion
----------

Doctrine registry

This updates the Doctrine bridge and DoctrineBundle to use the new ManagerRegistry interface and its methods instead of using the old methods which are marked as deprecated.
2011-10-16 22:40:57 +02:00
Fabien Potencier
8ae0af0b4f merged branch lsmith77/use_stmt_cleanups (PR #2408)
Commits
-------

18cca22 cleaned up the use statements in the Registry class and RegistryInterface

Discussion
----------

cleaned up the use statements in the Registry class and RegistryInterface

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -

just cosmetics ..
2011-10-16 22:38:09 +02:00
Fabien Potencier
f45b1df38c merged branch stof/router_check (PR #2409)
Commits
-------

63d2ce2 [FrameworkBundle] Fixed the ckeck for the router class

Discussion
----------

[FrameworkBundle] Fixed the ckeck for the router class

The getRouteCollection method is now part of the RouterInterface so the
command should accept any implementation of the interface instead of just
the implementations extending the core one.
2011-10-16 22:37:48 +02:00
Fabien Potencier
7399962ee8 merged branch hhamon/command_fix (PR #2411)
Commits
-------

64d970e [FrameworkBundle] removed "use" statements for unused classes.

Discussion
----------

[FrameworkBundle] removed "use" statements for unused classes.

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
2011-10-16 22:37:18 +02:00