Exemplo n.º 1
0
 /**
  * @param ApplicationInterface $application
  * @return $this
  */
 public function setApplication(ApplicationInterface $application)
 {
     $needReboot = $application !== $this->getApplication();
     $this->application = $application;
     if ($needReboot) {
         $this->boot();
         $application->getConfigLoader()->apply($this->getName(), $this);
     }
     return $this;
 }
Exemplo n.º 2
0
 /**
  *
  */
 public function initialize()
 {
     if (null === $this->map) {
         $map = [];
         # global
         foreach ($this->directories as $directory) {
             $map = array_merge_recursive($map, $this->map($directory . '/global'));
         }
         # local
         $env = $this->application->getEnv();
         foreach ($this->directories as $directory) {
             $map = array_merge_recursive($map, $this->map($directory . '/local/' . $env));
         }
         $this->map = $map;
     }
     return $this;
 }