Ejemplo n.º 1
0
 /**
  * Load and init a new OrionConfig instance, linking it to Orion.
  * @param string $filename The configuration file to use (No path, no extension, just the name).
  */
 public function configure($filename)
 {
     if (self::$CONFIG == null) {
         $class = self::CONF_NS . ucfirst($filename);
         try {
             self::$CONFIG = new $class();
             self::$CONFIG->load();
         } catch (Exception $e) {
             throw new Orion\Core\Exception('Configuration file does not exist.', E_USER_ERROR, get_class($this));
         }
     } else {
         throw new Orion\Core\Exception('Cannot load more than one config file.', E_USER_WARNING, get_class($this));
     }
 }