当前位置: 首页>>代码示例>>PHP>>正文


PHP HttpKernel::__construct方法代码示例

本文整理汇总了PHP中Symfony\Component\HttpKernel\HttpKernel::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP HttpKernel::__construct方法的具体用法?PHP HttpKernel::__construct怎么用?PHP HttpKernel::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symfony\Component\HttpKernel\HttpKernel的用法示例。


在下文中一共展示了HttpKernel::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($routes, Request $request, EventDispatcher $dispatcher, ControllerResolver $resolver)
 {
     $this->deflRes = new NodeResponse();
     $this->context = new RequestContext($request->getBaseUrl(), $request->getMethod(), $request->getHost(), $request->getScheme(), $request->getPort(), $request->getPort());
     $this->matcher = new UrlMatcher($routes, $this->context);
     parent::__construct($dispatcher, $resolver);
 }
开发者ID:renyunhuang,项目名称:nodephp,代码行数:7,代码来源:NodeCore.php

示例2: __construct

 public function __construct($environment = 'prod', $debug = false)
 {
     // dev, prod or schell
     define('Ki_ENVIRONMENT', $environment);
     define('Ki_DEBUG', is_bool($debug) ? $debug : false);
     if (Ki_DEBUG) {
         Debug::enable();
     } else {
         ini_set('display_errors', 0);
     }
     if (!in_array(Ki_ENVIRONMENT, array('dev', 'prod', 'shell'))) {
         throw new \Exception("El entorno '" . Ki_ENVIRONMENT . "' no está permitido en el sistema.");
     }
     // Agrega la instancia del kernel al contenedor de servicios.
     // Util para ser usada cuando de desde realizar una sub peticion dende en controlador.
     Service::instance('kernel', $this);
     // Registra la bolsa temporal en la session
     $session = Service::get('session');
     $session->registerBag(Service::get('temporary_bag'));
     $session->start();
     // Carga la configuracion del proyecto
     Service::get('config')->loadConfigGlobal();
     // Carga la configuracion de los bundles
     $this->registerBundles();
     // Carga la clase translator
     Service::get('translator')->loader(Service::get('session')->getLocale());
     $this->registerProviders();
     $this->registerListeners();
     if (Ki_ENVIRONMENT == 'shell') {
         Service::get('shell')->console();
         return;
     }
     parent::__construct(Service::get('event'), Service::get('kernel.resolver'));
 }
开发者ID:kodazzi,项目名称:framework,代码行数:34,代码来源:Kernel.php

示例3: __construct

 public function __construct($body, $status, $headers, \Closure $customizer = null)
 {
     $this->body = $body;
     $this->status = $status;
     $this->headers = $headers;
     $this->customizer = $customizer;
     parent::__construct(new EventDispatcher(), $this);
 }
开发者ID:TheTypoMaster,项目名称:SPHERE-Framework,代码行数:8,代码来源:TestHttpKernel.php

示例4: __construct

 /**
  * Constructor.
  *
  * @param EventDispatcherInterface    $dispatcher         An EventDispatcherInterface instance
  * @param ContainerInterface          $container          A ContainerInterface instance
  * @param ControllerResolverInterface $controllerResolver A ControllerResolverInterface instance
  */
 public function __construct(EventDispatcherInterface $dispatcher, ContainerInterface $container, ControllerResolverInterface $controllerResolver)
 {
     parent::__construct($dispatcher, $controllerResolver);
     $this->container = $container;
     // the request scope might have been created before (see FrameworkBundle)
     if (!$container->hasScope('request')) {
         $container->addScope(new Scope('request'));
     }
 }
开发者ID:ccq18,项目名称:EduSoho,代码行数:16,代码来源:ContainerAwareHttpKernel.php

示例5: __construct

 public function __construct($responses)
 {
     foreach ($responses as $response) {
         $this->bodies[] = $response['body'];
         $this->statuses[] = $response['status'];
         $this->headers[] = $response['headers'];
     }
     parent::__construct(new EventDispatcher(), $this);
 }
开发者ID:EnmanuelCode,项目名称:backend-laravel,代码行数:9,代码来源:TestMultipleHttpKernel.php

示例6: __construct

 /**
  * Constructor
  *
  * @param ServiceContainer            container
  * @param ApplicationInterface        $app
  * @param ControllerResolverInterface $resolver
  */
 public function __construct(ServiceContainer $container, ApplicationInterface $app, ControllerResolverInterface $resolver)
 {
     $this->container = $container;
     $this->resolver = $resolver;
     $this->container->setApp($app);
     $this->loadConfig()->loadRouting();
     $this->container->setConfig($app->getConfig());
     $this->dispatchEvent(KernelEvents::APP_LOADED, new KernelEvent($container));
     $this->container['kernel'] = $this;
     parent::__construct($this->container['core']['dispatcher'], $resolver);
 }
开发者ID:itkg,项目名称:core,代码行数:18,代码来源:KernelAbstract.php

示例7: __construct

 /**
  * Constructor.
  *
  * @param EventDispatcherInterface    $dispatcher         An EventDispatcherInterface instance
  * @param ContainerInterface          $container          A ContainerInterface instance
  * @param ControllerResolverInterface $controllerResolver A ControllerResolverInterface instance
  * @param RequestStack                $requestStack       A stack for master/sub requests
  * @param bool                        $triggerDeprecation Whether or not to trigger the deprecation warning for the ContainerAwareHttpKernel
  */
 public function __construct(EventDispatcherInterface $dispatcher, ContainerInterface $container, ControllerResolverInterface $controllerResolver, RequestStack $requestStack = null, $triggerDeprecation = true)
 {
     parent::__construct($dispatcher, $controllerResolver, $requestStack);
     if ($triggerDeprecation) {
         @trigger_error('The ' . __CLASS__ . ' class is deprecated since version 2.7 and will be removed in 3.0. Use the Symfony\\Component\\HttpKernel\\HttpKernel class instead.', E_USER_DEPRECATED);
     }
     $this->container = $container;
     // the request scope might have been created before (see FrameworkBundle)
     if (!$container->hasScope('request')) {
         $container->addScope(new Scope('request'));
     }
 }
开发者ID:papillon-cendre,项目名称:d8,代码行数:21,代码来源:ContainerAwareHttpKernel.php

示例8: __construct

 public function __construct()
 {
     $this->shared = array();
     $this->providers = array();
     $resolver = new ControllerResolver($this);
     $env = $this->getEnvironment();
     $this->dispatcher = new EventDispatcher();
     $this->dispatcher->addSubscriber(new EventListener\RedirectListener());
     $this->dispatcher->addSubscriber(new HttpKernel\EventListener\ResponseListener('UTF-8'));
     $this->dispatcher->addSubscriber(new ExceptionHandler($env == 'dev'));
     parent::__construct($this->dispatcher, $resolver);
 }
开发者ID:ubick,项目名称:glue,代码行数:12,代码来源:Application.php

示例9: __construct

 public function __construct()
 {
     $this->container = new Container();
     $this->initConfigs();
     $this->container->init($this);
     $this->initRoutes();
     $this->initModules();
     $this->initEnvironment();
     $this->initTimezone();
     $this->initUnicode();
     $this->container['kernel'] = $this;
     parent::__construct($this->container['dispatcher'], $this->container['resolver']);
 }
开发者ID:corpsee,项目名称:nameless-source,代码行数:13,代码来源:Application.php

示例10: __construct

 public function __construct($map)
 {
     $this->routes = new RouteCollection();
     foreach ($map as $pattern => $to) {
         if (false !== strpos($pattern, ' ')) {
             list($method, $pattern) = explode(' ', $pattern, 2);
             $requirements = array('_method' => $method);
         } else {
             $requirements = array();
         }
         $route = new Route($pattern, array('_controller' => $to), $requirements);
         $this->routes->add(str_replace(array('/', ':'), '_', $pattern), $route);
     }
     $dispatcher = new EventDispatcher();
     $dispatcher->connect('core.request', array($this, 'parseRequest'));
     $resolver = new ControllerResolver();
     parent::__construct($dispatcher, $resolver);
 }
开发者ID:radek-baczynski,项目名称:Silex,代码行数:18,代码来源:Framework.php

示例11: __construct

 public function __construct(EventDispatcherInterface $dispatcher, ContainerInterface $container, ControllerResolverInterface $controllerResolver)
 {
     parent::__construct($dispatcher, $controllerResolver);
     $this->container = $container;
 }
开发者ID:rebelde,项目名称:rebelde-symfony,代码行数:5,代码来源:classes.php

示例12: __construct

 public function __construct()
 {
     parent::__construct(new EventDispatcher(), $this);
 }
开发者ID:BusinessCookies,项目名称:CoffeeMachineProject,代码行数:4,代码来源:TestHttpKernel.php

示例13: __construct

 public function __construct(EventDispatcherInterface $dispatcher, ContainerInterface $container, ControllerResolverInterface $controllerResolver, RequestStack $requestStack = null)
 {
     parent::__construct($dispatcher, $controllerResolver, $requestStack);
     $this->container = $container;
     if (!$container->hasScope('request')) {
         $container->addScope(new Scope('request'));
     }
 }
开发者ID:global01,项目名称:victoire,代码行数:8,代码来源:bootstrap.php

示例14: __construct

 public function __construct()
 {
     $this->container = Container::getInstance();
     parent::__construct($this->container->get('dispatcher'), $this->container->get('resolver'));
 }
开发者ID:hidekscorporation,项目名称:hideksframework2,代码行数:5,代码来源:Bootstrap.php

示例15: __construct

 /**
  * Constructor.
  *
  * @param EventDispatcherInterface    $dispatcher         An EventDispatcherInterface instance
  * @param ContainerInterface          $container          A ContainerInterface instance
  * @param ControllerResolverInterface $controllerResolver A ControllerResolverInterface instance
  */
 public function __construct(EventDispatcherInterface $dispatcher, ContainerInterface $container, ControllerResolverInterface $controllerResolver)
 {
     parent::__construct($dispatcher, $controllerResolver);
     $this->container = $container;
     $container->addScope(new Scope('request'));
 }
开发者ID:nfabre,项目名称:symfony,代码行数:13,代码来源:ContainerAwareHttpKernel.php


注:本文中的Symfony\Component\HttpKernel\HttpKernel::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。