removed Kernel::isBooted() method

This commit is contained in:
Fabien Potencier 2011-01-23 13:17:50 +01:00
parent 005c1d9df8
commit 09aeb78634
4 changed files with 6 additions and 22 deletions

View File

@ -22,9 +22,6 @@ class InfoDoctrineCommandTest extends TestCase
$testContainer = $this->createYamlBundleTestContainer();
$kernel = $this->getMock('Symfony\Component\HttpKernel\Kernel', array(), array(), '', false);
$kernel->expects($this->once())
->method('isBooted')
->will($this->returnValue( true ));
$kernel->expects($this->once())
->method('getBundles')
->will($this->returnValue(array()));

View File

@ -48,9 +48,7 @@ abstract class Cache extends BaseCache
*/
protected function forward(Request $request, $raw = false, Response $entry = null)
{
if (!$this->kernel->isBooted()) {
$this->kernel->boot();
}
$this->kernel->boot();
$this->kernel->getContainer()->set('cache', $this);
$this->kernel->getContainer()->set('esi', $this->esi);

View File

@ -37,9 +37,7 @@ class Application extends BaseApplication
$this->definition->addOption(new InputOption('--shell', '-s', InputOption::VALUE_NONE, 'Launch the shell.'));
if (!$this->kernel->isBooted()) {
$this->kernel->boot();
}
$this->kernel->boot();
$this->registerCommands();
}

View File

@ -29,8 +29,9 @@ use Symfony\Component\HttpKernel\ClassCollectionLoader;
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
/**
* The Kernel is the heart of the Symfony system. It manages an environment
* that can host bundles.
* The Kernel is the heart of the Symfony system.
*
* It manages an environment made of bundles.
*
* @author Fabien Potencier <fabien.potencier@symfony-project.org>
*/
@ -105,16 +106,6 @@ abstract class Kernel implements HttpKernelInterface, \Serializable
*/
abstract public function registerContainerConfiguration(LoaderInterface $loader);
/**
* Checks whether the current kernel has been booted or not.
*
* @return Boolean $booted
*/
public function isBooted()
{
return $this->booted;
}
/**
* Boots the current kernel.
*
@ -126,7 +117,7 @@ abstract class Kernel implements HttpKernelInterface, \Serializable
public function boot()
{
if (true === $this->booted) {
throw new \LogicException('The kernel is already booted.');
return;
}
require_once __DIR__.'/bootstrap.php';