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


PHP AppKernel::shutdown方法代码示例

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


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

示例1: tearDown

 public function tearDown()
 {
     if (null !== $this->kernel) {
         $this->kernel->shutdown();
     }
     parent::tearDown();
 }
开发者ID:freedog96150,项目名称:puphpet,代码行数:7,代码来源:BaseTest.php

示例2: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     @unlink(__DIR__ . '/../Fixtures/Test/TestBundle/Resources/config/routing.rest.yml');
     @unlink(__DIR__ . '/../Fixtures/Test/TestBundle/Controller/CarController.php');
     @unlink(__DIR__ . '/../Fixtures/Test/TestBundle/Controller/OrderController.php');
     $kernel = new \AppKernel('test', true);
     $app = new Application($kernel);
     $app->addCommands(array(new GenerateRestControllerCommand()));
     $kernel->boot();
     $command = $app->find('generate:rest:controller');
     $commandTester = new CommandTester($command);
     $commandTester->execute(array('command' => $command->getName(), '--controller' => 'TestTestBundle:Order', '--entity' => 'TestTestBundle:Order', '--mongo' => true), array('interactive' => false));
     $kernel->shutdown();
     $kernel = new \AppKernel('test', true);
     $app = new Application($kernel);
     $app->addCommands(array(new GenerateRestControllerCommand()));
     $kernel->boot();
     $command = $app->find('generate:rest:controller');
     $commandTester = new CommandTester($command);
     $commandTester->execute(array('command' => $command->getName(), '--controller' => 'TestTestBundle:Car', '--entity' => 'TestTestBundle:Car'), array('interactive' => false));
     $kernel->shutdown();
     @unlink(__DIR__ . '/../app/cache/test/appTestUrlGenerator.php.meta');
     @unlink(__DIR__ . '/../app/cache/test/appTestUrlGenerator.php');
     @unlink(__DIR__ . '/../app/cache/test/appTestUrlMatcher.php.meta');
     @unlink(__DIR__ . '/../app/cache/test/appTestUrlMatcher.php');
 }
开发者ID:amstaffix,项目名称:extjs-bundle,代码行数:26,代码来源:BaseTestGeneratedRestController.php

示例3: up

 public function up(Schema $schema)
 {
     // this up() migration is autogenerated, please modify it to your needs
     $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
     $kernel = new \AppKernel('prod', false);
     $application = new Application($kernel);
     $application->setAutoExit(false);
     $application->run(new ArgvInput(array('', 'sns-migrate')));
     $kernel->shutdown();
 }
开发者ID:shakaran,项目名称:powerline-server,代码行数:10,代码来源:Version20140127190447.php

示例4: tearDownAfterClass

 public static function tearDownAfterClass()
 {
     parent::tearDownAfterClass();
     $kernel = new \AppKernel('test', true);
     $app = new Application($kernel);
     $app->addCommands(array(new DropDatabaseDoctrineCommand()));
     $kernel->boot();
     $command = $app->find('doctrine:database:drop');
     $commandTester = new CommandTester($command);
     $commandTester->execute(array('command' => $command->getName(), '--force' => true));
     $kernel->shutdown();
 }
开发者ID:amstaffix,项目名称:extjs-bundle,代码行数:12,代码来源:BaseTestGeneratedRestController.php

示例5: shutdown

 /**
  * {@inheritdoc}
  */
 public function shutdown()
 {
     if (false === $this->booted) {
         return;
     }
     if (!in_array($this->environment, ['test', 'test_cached'], true)) {
         parent::shutdown();
         return;
     }
     $container = $this->container;
     parent::shutdown();
     $this->cleanupContainer($container);
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:16,代码来源:TestAppKernel.php

示例6: testGenerateController

 public function testGenerateController()
 {
     @unlink(__DIR__ . '/../../Fixtures/Test/TestBundle/Resources/config/routing.rest.yml');
     @unlink(__DIR__ . '/../../Fixtures/Test/TestBundle/Controller/OrderController.php');
     $kernel = new \AppKernel('test', true);
     $app = new Application($kernel);
     $app->add(new GenerateRestControllerCommand());
     $kernel->boot();
     $command = $app->find('generate:rest:controller');
     $commandTester = new CommandTester($command);
     $commandTester->execute(array('command' => $command->getName(), '--controller' => 'TestTestBundle:Order', '--entity' => 'TestTestBundle:Order', '--mongo' => true), array('interactive' => false));
     $kernel->shutdown();
     $this->assertTrue(class_exists("\\Test\\TestBundle\\Controller\\OrderController"));
     $this->assertFileExists(__DIR__ . '/../../Fixtures/Test/TestBundle/Resources/config/routing.rest.yml');
     @unlink(__DIR__ . '/../../Fixtures/Test/TestBundle/Resources/config/routing.rest.yml');
     @unlink(__DIR__ . '/../../Fixtures/Test/TestBundle/Controller/OrderController.php');
 }
开发者ID:amstaffix,项目名称:extjs-bundle,代码行数:17,代码来源:GenerateRestControllerCommandTest.php

示例7: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     while (true) {
         /** @var \Doctrine\ORM\EntityManager $em */
         $em = $this->getContainer()->get('doctrine.orm.entity_manager');
         $payments = $em->getRepository(PaymentRequest::class)->findChargeNeeded();
         $foundCount = count($payments);
         $output->writeln("<comment>Found to charge: {$foundCount}</comment>");
         $kernel = new \AppKernel('prod', false);
         $application = new Application($kernel);
         $application->setAutoExit(false);
         foreach ($payments as $payment) {
             $output->writeln("<comment>Start charging: {$payment->getId()}</comment>");
             $application->run(new ArgvInput(array('', 'payment-request:charge', $payment->getId())));
             $output->writeln("<comment>Payment {$payment->getId()} has charged</comment>");
         }
         $kernel->shutdown();
         $em->clear();
         sleep(60);
     }
     $output->writeln('Started.');
 }
开发者ID:shakaran,项目名称:powerline-server,代码行数:22,代码来源:ChargePaymentRequestDaemonCommand.php

示例8: tearDown

 public function tearDown()
 {
     $this->kernel->shutdown();
     parent::tearDown();
 }
开发者ID:Codixis,项目名称:CSBill,代码行数:5,代码来源:KernelAwareTest.php

示例9: tearDown

 public function tearDown()
 {
     self::$kernel->shutdown();
 }
开发者ID:scr-be,项目名称:arthur-doctrine-fixtures-bundle,代码行数:4,代码来源:ScribeArthurDoctrineFixturesBundleTest.php

示例10: AppKernel

<?php

$loader = (require_once __DIR__ . '/bootstrap.php');
require_once __DIR__ . '/sf2app/app/AppKernel.php';
$kernel = new AppKernel('test', true);
$kernel->boot();
$gmc = $kernel->getContainer()->get('supertag_gearman.client');
//$gmc->doBackground('failing.gearman.job', 'workload');
//exit(0);
for ($i = 0; $i < 100; $i++) {
    $gmc->doBackground('failing.gearman.job', 'workload' . $i);
    if ($i % 10 === 0) {
        $gmc->doLowBackground('sleepy.gearman.job', 'workload' . $i);
    }
    if ($i === 50 || $i === 80) {
        $gmc->doHighBackground('high.gearman.job', 'workload' . $i);
    }
    $gmc->doBackground('normal.gearman.job', 'workload' . $i);
}
$kernel->shutdown();
开发者ID:mmz-srf,项目名称:GearmanBundle,代码行数:20,代码来源:client.php

示例11: tearDown

 public function tearDown()
 {
     if (self::$kernel instanceof \AppKernel) {
         self::$kernel->shutdown();
     }
 }
开发者ID:scr-be,项目名称:teavee-block-manager-bundle,代码行数:6,代码来源:ScribeTeaveeBlockManagerBundleTest.php


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