Ejemplo n.º 1
0
 protected function initializeConfig()
 {
     $configLoader = new Piece_Unity_ConfigLoader();
     if (!is_null($this->exclusiveDirectory)) {
         $configLoader->addConfigDirectory($this->exclusiveDirectory);
     }
     $this->config = $configLoader->load();
 }
Ejemplo n.º 2
0
 /**
  * Creates the Piece_Unity object for the current request, and invokes the given
  * callback for any configuration.
  *
  * @param array    $configDirectories
  * @param callback $callback
  * @return Piece_Unity
  * @since Method available since Release 1.5.0
  */
 public static function createRuntime(array $configDirectories, $callback = null)
 {
     $configLoader = new Piece_Unity_ConfigLoader();
     foreach ($configDirectories as $configDirectory) {
         $configLoader->addConfigDirectory($configDirectory);
     }
     $config = $configLoader->load();
     if (!is_null($callback)) {
         call_user_func($callback, $config);
     }
     return $config->materializeFeature(__CLASS__);
 }