/**
* {@inheritdoc}
*/
public function boot(ContainerInterface $container)
{
if (empty($this->options)) {
throw new \RuntimeException('You must provide options for the Symfony 1.4 kernel.');
}
if ($this->isBooted()) {
return;
}
if ($this->classLoader && !$this->classLoader->isAutoloaded()) {
$this->classLoader->autoload();
}
$dispatcher = $container->get('event_dispatcher');
$event = new LegacyKernelBootEvent($container->get('request'), $this->options);
$dispatcher->dispatch(LegacyKernelEvents::BOOT, $event);
$this->options = $event->getOptions();
require_once $this->rootDir . '/config/ProjectConfiguration.class.php';
$application = $this->options['application'];
$environment = $this->options['environment'];
$debug = $this->options['debug'];
$this->configuration = \ProjectConfiguration::getApplicationConfiguration($application, $environment, $debug, $this->getRootDir());
$this->configuration->loadHelpers(array('Url'));
// Create a context to use with some helpers like Url.
if (!\sfContext::hasInstance()) {
$session = $container->get('session');
if ($session->isStarted()) {
$session->save();
}
ob_start();
\sfContext::createInstance($this->configuration);
ob_end_flush();
$session->migrate();
}
$this->isBooted = true;
}