當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ConfigManager::setGlobalConfig方法代碼示例

本文整理匯總了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()));
 }
開發者ID:alexamiryan,項目名稱:stingle,代碼行數:12,代碼來源:ConfigDBManager.class.php

示例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()));
 }
開發者ID:Welvin,項目名稱:stingle,代碼行數:16,代碼來源:ConfigDBManager.class.php

示例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));
            }
開發者ID:alexamiryan,項目名稱:stingle,代碼行數:31,代碼來源:init.php


注:本文中的ConfigManager::setGlobalConfig方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。