public static function factory($id, $type, $options=0) { $config = new ModuleConfigFile(); if (!$result = $config->loadFileType($id, $type, $options)) { die("FATAL ERROR: cannot load $type configuration file: " . self::getfileByType($id, $type)); } return $config; }
public static function factory($id, $type = 'file', $options = 0) { $config = new ModuleConfigFile(); if (!($options & self::OPTION_DO_NOT_CREATE)) { $options = $options | self::OPTION_CREATE_WITH_DEFAULT; } if (!($result = $config->loadFileType($id, $type, $options))) { if ($options & self::OPTION_DO_NOT_CREATE) { return false; } throw new KurogoConfigurationException("FATAL ERROR: cannot load {$type} configuration file for module {$id}: " . self::getfileByType($id, $type)); } return $config; }
public static function factory($configModule, $type = 'file', $options = 0) { $args = func_get_args(); $module = isset($args[3]) ? $args[3] : null; $config = new ModuleConfigFile(); if ($module) { $config->setModule($module); } if (!($options & self::OPTION_DO_NOT_CREATE)) { $options = $options | self::OPTION_CREATE_WITH_DEFAULT; } if (!($result = $config->loadFileType($configModule, $type, $options))) { if ($options & self::OPTION_DO_NOT_CREATE) { return false; } throw new KurogoConfigurationException("FATAL ERROR: cannot load {$type} configuration file for module {$configModule}"); } return $config; }