Example #1
0
 /**
  * Bootstrap the singleton and read the config from file
  *
  * @var path to config file
  * @throws Exception config object not found if $config is not set in config file
  * @throws Exception config file not found if $path is leading nowhere
  */
 private static function bootstrap($path = null)
 {
     if (!isset($path)) {
         $path = ROOT . self::$_default_path;
     }
     self::$_path = $path;
     if (is_file(self::$_path)) {
         include self::$_path;
         if (!isset($config)) {
             throw new Exception('ERROR The config object was not found in ' . self::$_path);
         } else {
             self::$_config = $config;
         }
     } else {
         throw new Exception('ERROR The config file not found at' . self::$_path);
     }
 }