Created
June 14, 2012 12:15
-
-
Save coreymcmahon/2929949 to your computer and use it in GitHub Desktop.
Shifting code to the framework core to manage dependencies - http://www.symfonycentral.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Simplex; | |
use Symfony\Component\Routing; | |
use Symfony\Component\HttpKernel; | |
use Symfony\Component\EventDispatcher\EventDispatcher; | |
class Framework extends HttpKernel\HttpKernel | |
{ | |
public function __construct($routes) | |
{ | |
$context = new Routing\RequestContext(); | |
$matcher = new Routing\Matcher\UrlMatcher($routes, $context); | |
$resolver = new HttpKernel\Controller\ControllerResolver(); | |
$dispatcher = new EventDispatcher(); | |
$dispatcher->addSubscriber(new HttpKernel\EventListener\RouterListener($matcher)); | |
$dispatcher->addSubscriber(new HttpKernel\EventListener\ResponseListener('UTF-8')); | |
parent::__construct($dispatcher, $resolver); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment