当前位置: 首页>>代码示例>>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;未经允许,请勿转载。