本文整理汇总了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();
}
示例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');
}
示例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();
}
示例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();
}
示例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);
}
示例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');
}
示例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.');
}
示例8: tearDown
public function tearDown()
{
$this->kernel->shutdown();
parent::tearDown();
}
示例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();
示例11: tearDown
public function tearDown()
{
if (self::$kernel instanceof \AppKernel) {
self::$kernel->shutdown();
}
}