本文整理汇总了PHP中ConfigManager::setGlobalConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP ConfigManager::setGlobalConfig方法的具体用法?PHP ConfigManager::setGlobalConfig怎么用?PHP ConfigManager::setGlobalConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigManager
的用法示例。
在下文中一共展示了ConfigManager::setGlobalConfig方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initDBConfig
/**
* Get configs from DB and merge them with global config
*
* @param int $cacheMinutes
*/
public static function initDBConfig($cacheMinutes = null)
{
$sql = MySqlDbManager::getQueryObject();
$sql->exec("SELECT * FROM `" . Tbl::get("TBL_CONFIGS") . "`", $cacheMinutes);
$dbConfig = static::parseDBRowsToConfig($sql->fetchRecords());
ConfigManager::setGlobalConfig(ConfigManager::mergeConfigs($dbConfig, ConfigManager::getGlobalConfig()));
}
示例2: initDBConfig
/**
* Get configs from DB and merge them with global config
*
* @param int $cacheMinutes
*/
public static function initDBConfig(ConfigDBFilter $filter = null, $cacheMinutes = 0)
{
if ($filter == null) {
$filter = new ConfigDBFilter();
$filter->setCommon();
}
$sql = MySqlDbManager::getQueryObject();
$sql->exec($filter->getSQL(), $cacheMinutes);
$dbConfig = static::parseDBRowsToConfig($sql->fetchRecords());
ConfigManager::setGlobalConfig(ConfigManager::mergeConfigs($dbConfig, ConfigManager::getGlobalConfig()));
}
示例3: register_shutdown_function
require_once STINGLE_PATH . "core/Loader.class.php";
require_once STINGLE_PATH . "core/Model.class.php";
require_once STINGLE_PATH . "core/PackageManager.class.php";
require_once STINGLE_PATH . "core/Reg.class.php";
require_once STINGLE_PATH . "core/SiteMode.class.php";
require_once STINGLE_PATH . "core/Exceptions/EmptyArgumentException.class.php";
require_once STINGLE_PATH . "core/Exceptions/InvalidArrayArgumentException.class.php";
require_once STINGLE_PATH . "core/Exceptions/InvalidIntegerArgumentException.class.php";
require_once STINGLE_PATH . "core/Exceptions/InvalidTimestampArgumentException.class.php";
require_once STINGLE_PATH . "functions/system.php";
require_once STINGLE_PATH . "functions/func.php";
register_shutdown_function("shutdown");
set_exception_handler("default_exception_handler");
set_error_handler(create_function('$severity, $message, $file, $line', 'throw new ErrorException($message, $severity, $severity, $file, $line);'));
$config = new Config($CONFIG);
ConfigManager::setGlobalConfig($config);
Reg::register('packageMgr', new PackageManager());
error_reporting($config->site->error_reporting);
session_name($config->site->site_id);
session_start();
ob_start('stingleOutputHandler');
Cgi::setMode(defined("IS_CGI"));
Debug::setMode($config->Debug->enabled);
SiteMode::set($config->SiteMode->mode);
// Register User Hooks
if (isset($config->Hooks)) {
foreach (get_object_vars($config->Hooks) as $hookName => $funcName) {
if (is_object($funcName)) {
foreach (get_object_vars($funcName) as $regFuncName) {
HookManager::registerHook(new Hook($hookName, $regFuncName));
}