示例#1
0
 public static function build(array $configuration)
 {
     $routeCollection = new RouteCollection();
     $urlMatcher = new UrlMatcher();
     $logger = LoggerProvider::build($configuration);
     return new FrontendController($routeCollection, $urlMatcher, $logger);
 }
示例#2
0
 private static function buildForDebug($configuration, $dispatcher, $frontendController)
 {
     $controllerResolver = new ControllerResolver();
     $dispatcher->addSubscriber(new Firewall($configuration['security.firewalls'], $controllerResolver));
     $logger = LoggerProvider::build($configuration);
     $dispatcher->addSubscriber(new LogListener($logger));
     $dispatcher->addSubscriber(new ResponseListener($configuration['charset']));
     $dispatcher->addSubscriber(new StringToResponseListener());
     $resolver = new RequestControllerResolver($dispatcher, $controllerResolver);
     $requestStack = new RequestStack();
     return new HttpKernel($dispatcher, $resolver, $requestStack, $frontendController);
 }