Exemple #1
0
 /**
  * @param IContainer $container
  */
 public function __construct(IContainer $container)
 {
     $this->container = $container;
     $path = dirname(str_replace(['\\', 'App'], ['/', $container->kernel->getAppDir()], get_called_class())) . '/config.php';
     if (file_exists($path)) {
         $container->load($path);
     }
 }
Exemple #2
0
 /**
  * Initialize container
  *
  * @access public
  *
  * @param string $configPath Path to configure Container
  *
  * @return void
  */
 public function initContainer($configPath)
 {
     $this->container = new Container();
     $this->container->kernel = $this;
     $this->container->load($configPath);
     if (false === $this->container->dispatcher) {
         $this->container->dispatcher = new Dispatcher($this->container);
     }
 }