當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。