本文整理匯總了PHP中PHPWS_Settings::loadConfig方法的典型用法代碼示例。如果您正苦於以下問題:PHP PHPWS_Settings::loadConfig方法的具體用法?PHP PHPWS_Settings::loadConfig怎麽用?PHP PHPWS_Settings::loadConfig使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PHPWS_Settings
的用法示例。
在下文中一共展示了PHPWS_Settings::loadConfig方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: load
/**
* Loads the settings into the session
*
*/
public static function load($module)
{
$default = PHPWS_Settings::loadConfig($module);
if (!$default) {
$GLOBALS['PHPWS_Settings'][$module] = 1;
return PHPWS_Error::get(SETTINGS_MISSING_FILE, 'core', 'PHPWS_Settings::load', $module);
}
include $default;
PHPWS_Settings::set($module, $settings);
$db = new PHPWS_DB('mod_settings');
$db->addWhere('module', $module);
$result = $db->select();
if (PHPWS_Error::isError($result)) {
return $result;
} elseif (empty($result)) {
PHPWS_Settings::save($module);
} else {
foreach ($result as $key => $value) {
switch ($value['setting_type']) {
case 1:
$setval = $value['small_num'];
break;
case 2:
$setval = $value['large_num'];
break;
case 3:
$setval = $value['small_char'];
break;
case 4:
$setval = $value['large_char'];
break;
}
PHPWS_Settings::set($module, $value['setting_name'], $setval);
}
}
return true;
}