Esempio n. 1
0
 public static function factory($file, $type='file', $options=0) {
   $config = new ConfigFile();
   
   if (!$result = $config->loadFileType($file, $type, $options)) {
      die("FATAL ERROR: cannot load $type configuration file: " . self::getfileByType($file, $type));
   }
   
   return $config;
 }
 public static function factory($file, $type='file', $options=0) {
   $config = new ConfigFile();
   
   if (!$result = $config->loadFileType($file, $type, $options)) {
       if ($options & ConfigFile::OPTION_DIE_ON_FAILURE) {
         die("FATAL ERROR: cannot load $type configuration file: $file");
       }
   }
   
   return $config;
 }
Esempio n. 3
0
 public static function factory($file, $type = 'file', $options = 0)
 {
     Kurogo::log(LOG_DEBUG, "Loading config file {$file} of type {$type} with options {$options}", 'config');
     $config = new ConfigFile();
     if (!($options & self::OPTION_DO_NOT_CREATE)) {
         $options = $options | self::OPTION_CREATE_WITH_DEFAULT;
     }
     if (!($result = $config->loadFileType($file, $type, $options))) {
         if ($options & self::OPTION_DO_NOT_CREATE) {
             return false;
         }
         throw new KurogoConfigurationException("FATAL ERROR: cannot load {$type} configuration file: " . self::getfileByType($file, $type));
     }
     return $config;
 }
Esempio n. 4
0
 public static function factory($file, $type='file', $options=0) {
   $config = new ConfigFile();
   if (!($options & self::OPTION_DO_NOT_CREATE)) {
       $options = $options | self::OPTION_CREATE_WITH_DEFAULT;
   }
   
   if (!$result = $config->loadFileType($file, $type, $options)) {
       if ($options & self::OPTION_DO_NOT_CREATE) {
           return false;
       }
      throw new Exception("FATAL ERROR: cannot load $type configuration file: " . self::getfileByType($file, $type));
   }
   
   return $config;
 }