Esempio n. 1
0
 protected function refreshContainer()
 {
     $container = $this->getContainer();
     /** @var Session $session */
     if (($session = $container->getByType('Nette\\Http\\Session')) && $session->isStarted()) {
         $session->close();
     }
     $this->container = new $container();
     $this->container->initialize();
 }
Esempio n. 2
0
 public function reloadContainer()
 {
     $this->presenterFactory = NULL;
     $container = $this->getContainer();
     $configurator = $this->getConfigurator();
     $class = $container->parameters['container']['class'] . '_test_' . $this->containerCounter++;
     \Nette\Utils\LimitedScope::evaluate($configurator->buildContainer($dependencies, $class));
     $this->container = new $class();
     $this->container->initialize();
     $this->container->addService('configurator', $configurator);
 }
Esempio n. 3
0
 /**
  * Reload system container.
  */
 protected function reloadSystemContainer()
 {
     /** @var $configurator Configurator */
     $configurator = $this->context->configurator;
     $class = $this->context->parameters['container']['class'] . $this->_systemContainer++;
     LimitedScope::evaluate($configurator->buildContainer($dependencies, $class));
     /** @var context Container */
     $this->context = new $class();
     $this->context->parameters = (include $this->configDir . '/settings.php') + $this->context->parameters;
     $this->context->initialize();
     $this->context->addService("configurator", $configurator);
 }