本文整理匯總了PHP中ConfigFile::loadFileType方法的典型用法代碼示例。如果您正苦於以下問題:PHP ConfigFile::loadFileType方法的具體用法?PHP ConfigFile::loadFileType怎麽用?PHP ConfigFile::loadFileType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ConfigFile
的用法示例。
在下文中一共展示了ConfigFile::loadFileType方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: factory
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;
}
示例2: factory
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;
}
示例3: factory
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;
}
示例4: factory
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;
}