/**
  * 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
0
 /**
  * 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
0
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));
            }