8000 Synchronized Service alternative, backwards compatible by fabpot · Pull Request #8904 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Synchronized Service alternative, backwards compatible #8904

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

Merged
merged 7 commits into from
Sep 8, 2013
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[HttpKernel] renamed the kernel finished event
  • Loading branch information
fabpot committed Sep 7, 2013
commit f9b10ba1d5715832fd12a930e282abdb3b2ea462
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
*
* @author Benjamin Eberlei <kontakt@beberlei.de>
*/
class RequestFinishedEvent extends KernelEvent
class FinishRequestEvent extends KernelEvent
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace Symfony\Component\HttpKernel\EventListener;

use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Event\RequestFinishedEvent;
use Symfony\Component\HttpKernel\Event\FinishRequestEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\RequestContext;
use Symfony\Component\HttpFoundation\Request;
Expand Down Expand Up @@ -46,7 +46,7 @@ public function onKernelRequest(GetResponseEvent $event)
$this->setRouterContext($request);
}

public function onKernelRequestFinished(RequestFinishedEvent $event)
public function onKernelFinishRequest(FinishRequestEvent $event)
{
$this->resetRouterContext();
}
Expand Down Expand Up @@ -85,7 +85,7 @@ public static function getSubscribedEvents()
return array(
// must be registered after the Router to have access to the _locale
KernelEvents::REQUEST => array(array('onKernelRequest', 16)),
KernelEvents::REQUEST_FINISHED => array(array('onKernelRequestFinished', 0)),
KernelEvents::FINISH_REQUEST => array(array('onKernelFinishRequest', 0)),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

use Psr\Log\LoggerInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Event\RequestFinishedEvent;
use Symfony\Component\HttpKernel\Event\FinishRequestEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
Expand Down Expand Up @@ -83,7 +83,7 @@ private function populateRoutingContext(Request $request = null)
$this->request = $request;
}

public function onKernelRequestFinished(RequestFinishedEvent $event)
public function onKernelFinishRequest(FinishRequestEvent $event)
{
$this->populateRoutingContext($this->kernelContext->getParentRequest());
}
Expand Down Expand Up @@ -148,7 +148,7 @@ public static function getSubscribedEvents()
{
return array(
KernelEvents::REQUEST => array(array('onKernelRequest', 32)),
KernelEvents::REQUEST_FINISHED => array(array('onKernelRequestFinished', 0)),
KernelEvents::FINISH_REQUEST => array(array('onKernelFinishRequest', 0)),
);
}
}
4 changes: 2 additions & 2 deletions src/Symfony/Component/HttpKernel/HttpKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\Event\RequestFinishedEvent;
use Symfony\Component\HttpKernel\Event\FinishRequestEvent;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
Expand Down Expand Up @@ -183,7 +183,7 @@ private function filterResponse(Response $response, Request $request, $type)
*/
private function finishRequest(Request $request, $type)
{
$this->dispatcher->dispatch(KernelEvents::REQUEST_FINISHED, new RequestFinishedEvent($this, $request, $type));
$this->dispatcher->dispatch(KernelEvents::FINISH_REQUEST, new FinishRequestEvent($this, $request, $type));
$this->requestStack->pop();
}

Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpKernel/KernelEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,5 @@ final class KernelEvents
*
* @var string
*/
const REQUEST_FINISHED = 'kernel.request_finished';
const FINISH_REQUEST = 'kernel.finish_request';
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function testLocaleSetForRoutingContext()
$listener->onKernelRequest($this->getEvent($request));
}

public function testRouterResetWithParentRequestOnKernelRequestFinished()
public function testRouterResetWithParentRequestOnKernelFinishRequest()
{
if (!class_exists('Symfony\Component\Routing\Router')) {
$this->markTestSkipped('The "Routing" component is not available');
Expand All @@ -83,10 +83,10 @@ public function testRouterResetWithParentRequestOnKernelRequestFinished()

$this->context->expects($this->once())->method('getParentRequest')->will($this->returnValue($parentRequest));

$event = $this->getMock('Symfony\Component\HttpKernel\Event\RequestFinishedEvent', array(), array(), '', false);
$event = $this->getMock('Symfony\Component\HttpKernel\Event\FinishRequestEvent', array(), array(), '', false);

$listener = new LocaleListener('fr', $this->context, $router);
$listener->onKernelRequestFinished($event);
$listener->onKernelFinishRequest($event);
}

public function testRequestLocaleIsNotOverridden()
Expand Down
0