Skip to content

Commit

Permalink
Update RequestListener to the new event framework
Browse files Browse the repository at this point in the history
  • Loading branch information
mbontemps committed Mar 27, 2011
1 parent ec61f07 commit 1583da1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Listener/RequestListener.php
Expand Up @@ -3,7 +3,7 @@
namespace Avalanche\Bundle\ImagineBundle\Listener;

use Avalanche\Bundle\ImagineBundle\Imagine\CachePathResolver;
use Symfony\Component\EventDispatcher\EventInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface;

class RequestListener
Expand All @@ -22,17 +22,18 @@ public function __construct(CachePathResolver $resolver)
}

/**
* @param Symfony\Component\EventDispatcher\EventInterface $event
* @param Symfony\Component\HttpKernel\Event\GetResponseEvent
*/
public function handle(EventInterface $event)
public function onCoreRequest(GetResponseEvent $event)
{
if ($event->get('request_type') !== HttpKernelInterface::MASTER_REQUEST) {
if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
return;
}

$request = $event->get('request');
$request = $event->getRequest();

$this->resolver->setBasePath($request->getBasePath());
$this->resolver->setBaseUrl($request->getBaseUrl());
}

}

0 comments on commit 1583da1

Please sign in to comment.