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


PHP KernelInterface::boot方法代码示例

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


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

示例1: setUp

 /**
  * Set up test
  */
 public function setUp()
 {
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     static::$application = new Application(static::$kernel);
     static::$application->setAutoExit(false);
 }
开发者ID:sovaalexandr,项目名称:OpenExchangeRatesBundle,代码行数:10,代码来源:OpenExchangeRatesServiceTest.php

示例2: setUp

 public function setUp()
 {
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     $this->dm = static::$kernel->getContainer()->get('doctrine.odm.mongodb.document_manager');
     parent::setUp();
 }
开发者ID:Nameless0ne,项目名称:Aisel,代码行数:7,代码来源:AbstractKernelTestCase.php

示例3: getRouter

 /**
  * @return RouterInterface
  */
 private function getRouter()
 {
     if (null === $this->router) {
         $this->kernel->boot();
         $this->router = $this->kernel->getContainer()->get('router');
     }
     return $this->router;
 }
开发者ID:GoldenLine,项目名称:WebApiExtension,代码行数:11,代码来源:RouterContext.php

示例4: initKernel

 private static function initKernel()
 {
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     static::$container = static::$kernel->getContainer();
     static::$doctrine = static::$container->get('doctrine');
     static::$om = static::$doctrine->getManager();
 }
开发者ID:eugene-matvejev,项目名称:battleship-game-api,代码行数:8,代码来源:AbstractKernelTestSuite.php

示例5: setKernel

 /**
  * {@inheritdoc}
  */
 public function setKernel(KernelInterface $kernel)
 {
     $this->kernel = $kernel;
     if (null === self::$sharedKernel) {
         self::$sharedKernel = clone $kernel;
         self::$sharedKernel->boot();
     }
 }
开发者ID:Mozan,项目名称:Sylius,代码行数:11,代码来源:DefaultContext.php

示例6: getContainer

 /**
  * @return ContainerInterface
  */
 private function getContainer()
 {
     if ($this->kernel === null) {
         $this->kernel = $this->createKernel();
         $this->kernel->boot();
     }
     return $this->kernel->getContainer();
 }
开发者ID:mcfedr,项目名称:resque-queue-driver-bundle,代码行数:11,代码来源:Job.php

示例7: getIterator

 /**
  * Returns an iterator that provides Twig template paths.
  *
  * @return \Traversable
  */
 public function getIterator()
 {
     $this->kernel->boot();
     $viewDirectories = $this->getPossibleViewDirectories();
     $viewDirectories = $this->removeNotExistingDirectories($viewDirectories);
     $templates = $this->getTwigTemplatesIn($viewDirectories);
     return new \ArrayIterator($templates);
 }
开发者ID:webfactory,项目名称:symfony-application-tests,代码行数:13,代码来源:TwigTemplateIterator.php

示例8: getContainer

 /**
  * @return ContainerInterface
  */
 protected function getContainer()
 {
     if ($this->kernel === NULL) {
         $this->kernel = $this->createKernel();
         $this->kernel->boot();
     }
     return $this->kernel->getContainer();
 }
开发者ID:resquebundle,项目名称:resque,代码行数:11,代码来源:ContainerAwareJob.php

示例9: buildClient

 /**
  * Build client
  *
  * @return $this Self object
  */
 public function buildClient()
 {
     $this->kernel = new \AppKernel('test', false);
     $this->kernel->boot();
     $this->session->clear();
     $this->client = $this->kernel->getContainer()->get('test.client');
     $this->environmentBuilder->setUp($this->kernel);
 }
开发者ID:jverdeyen-forks,项目名称:VisithorBundle,代码行数:13,代码来源:SymfonyClient.php

示例10: setUp

 public function setUp()
 {
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     $this->client = static::createClient([], ['HTTP_HOST' => static::$httpHost]);
     $this->dm = static::$kernel->getContainer()->get('doctrine.odm.mongodb.document_manager');
     $this->um = static::$kernel->getContainer()->get('backend.user.manager');
     $this->locales = explode("|", static::$kernel->getContainer()->getParameter('locales'));
     $this->api = array('frontend' => static::$kernel->getContainer()->getParameter('frontend_api'), 'backend' => static::$kernel->getContainer()->getParameter('backend_api'));
     parent::setUp();
 }
开发者ID:hbg-utopixar,项目名称:Aisel,代码行数:11,代码来源:AbstractWebTestCase.php

示例11: createClient

 /**
  * Creates a Client.
  *
  * @param array $options An array of options to pass to the createKernel class
  * @param array $server  An array of server parameters
  *
  * @return Client A Client instance
  */
 protected static function createClient(array $options = array(), array $server = array())
 {
     if (null !== static::$kernel) {
         static::$kernel->shutdown();
     }
     static::$kernel = static::createKernel($options);
     static::$kernel->boot();
     $client = static::$kernel->getContainer()->get('test.client');
     $client->setServerParameters($server);
     return $client;
 }
开发者ID:ccq18,项目名称:EduSoho,代码行数:19,代码来源:WebTestCase.php

示例12: setUp

 public function setUp()
 {
     // Boot the AppKernel in the test environment and with the debug.
     $this->kernel = new \AppKernel('test', true);
     $this->kernel->boot();
     // Store the container and the entity manager in test case properties
     $this->container = $this->kernel->getContainer();
     $this->entityManager = $this->container->get('doctrine')->getEntityManager();
     // Build the schema for sqlite
     $this->generateSchema();
     parent::setUp();
 }
开发者ID:leapt,项目名称:core-bundle,代码行数:12,代码来源:IntegrationTestCase.php

示例13: setUp

 protected function setUp()
 {
     if (!isset($this->serviceName)) {
         throw new Exception("Service name has to be set");
     }
     $this->_kernel = $this->createKernel();
     $this->_kernel->boot();
     try {
         $this->manager = $this->_kernel->getContainer()->get($this->serviceName);
     } catch (ServiceNotFoundException $notFoundException) {
         throw new Exception("The service " . $this->serviceName . " has to be registered.");
     }
 }
开发者ID:mapbender,项目名称:search,代码行数:13,代码来源:ManagerTest.php

示例14: setUpBeforeClass

 /**
  * Set up before class.
  *
  * @throws RuntimeException unable to start the application
  */
 public static function setUpBeforeClass()
 {
     try {
         static::$kernel = static::createKernel();
         static::$kernel->boot();
         static::$application = new Application(static::$kernel);
         static::$application->setAutoExit(false);
         static::$container = static::$kernel->getContainer();
     } catch (Exception $e) {
         throw new RuntimeException(sprintf('Unable to start the application: %s', $e->getMessage()), $e->getCode(), $e);
     }
     static::createSchema();
 }
开发者ID:VictorMateo,项目名称:elcodi,代码行数:18,代码来源:WebTestCase.php

示例15: doRequest

 /**
  * {@inheritdoc}
  */
 protected function doRequest($request)
 {
     if ($this->hasPerformedRequest) {
         $this->kernel->shutdown();
         $this->kernel->boot();
     } else {
         $this->hasPerformedRequest = true;
     }
     $this->refreshDoctrineConnection();
     $response = $this->kernel->handle($request);
     if ($this->kernel instanceof TerminableInterface) {
         $this->kernel->terminate($request, $response);
     }
     return $response;
 }
开发者ID:Maksold,项目名称:platform,代码行数:18,代码来源:Client.php


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