Commit 36bef409 authored by Fabien Potencier's avatar Fabien Potencier

changed Application to implements HttpKernelInterface instead of extending HttpKernel

parent 8c9889d0
......@@ -12,6 +12,7 @@
namespace Silex;
use Symfony\Component\HttpKernel\HttpKernel;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Controller\ControllerResolver;
use Symfony\Component\HttpKernel\Event\KernelEvent;
use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent;
......@@ -33,12 +34,13 @@ use Symfony\Component\Routing\Matcher\Exception\NotFoundException;
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class Application extends HttpKernel implements EventSubscriberInterface
class Application implements HttpKernelInterface, EventSubscriberInterface
{
private $dispatcher;
private $routes;
private $controllers;
private $request;
private $kernel;
/**
* Constructor.
......@@ -54,7 +56,7 @@ class Application extends HttpKernel implements EventSubscriberInterface
$resolver = new ControllerResolver();
parent::__construct($this->dispatcher, $resolver);
$this->kernel = new HttpKernel($this->dispatcher, $resolver);
}
/**
......@@ -247,6 +249,11 @@ class Application extends HttpKernel implements EventSubscriberInterface
$this->handle($request)->send();
}
function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
return $this->kernel->handle($request, $type, $catch);
}
/**
* Handles onCoreRequest events.
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment