Index: branches/5.1.x/core/kernel/utility/unit_config_reader.php =================================================================== diff -u -N -r13113 -r13168 --- branches/5.1.x/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 13113) +++ branches/5.1.x/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 13168) @@ -1,6 +1,6 @@ Application->recallObject('TagsAggregator', 'kArray'); $config_vars = Array ( + // session related 'SessionTimeout', 'SessionCookieName', 'SessionBrowserSignatureCheck', 'SessionIPAddressCheck', 'CookieSessions', - 'UseCronForRegularEvent', + 'SessionTimeout', + 'KeepSessionOnBrowserClose', 'User_GuestGroup', 'User_LoggedInGroup', - 'SessionTimeout', + + // output related 'UseModRewrite', 'UseOutputCompression', 'OutputCompressionLevel', - 'KeepSessionOnBrowserClose', 'Config_Server_Time', 'Config_Site_Time', + 'SystemTagCache', + + // tracking related 'UseChangeLog', 'UseVisitorTracking', + 'UseCronForRegularEvent', ); foreach ($config_vars as $var) { @@ -123,28 +129,32 @@ 'Application.ModuleInfo' => $this->Application->ModuleInfo, ); - $conn =& $this->Application->GetADODBConnection(); - if (isset($this->Application->Memcached)) { - $this->Application->Memcached->set('master:configs_parsed', serialize($cache)); - $this->Application->Memcached->set('master:config_files', serialize($this->configFiles)); + if ($this->Application->isCachingType(CACHING_TYPE_MEMORY)) { + $this->Application->setCache('master:configs_parsed', serialize($cache)); + $this->Application->setCache('master:config_files', serialize($this->configFiles)); } else { - $conn->Query('REPLACE '.TABLE_PREFIX.'Cache (VarName, Data, Cached) VALUES ("configs_parsed", '.$conn->qstr(serialize($cache)).', '.adodb_mktime().')'); - $conn->Query('REPLACE '.TABLE_PREFIX.'Cache (VarName, Data, Cached) VALUES ("config_files", '.$conn->qstr(serialize($this->configFiles)).', '.adodb_mktime().')'); + $this->Application->setDBCache('configs_parsed', serialize($cache)); + $this->Application->setDBCache('config_files', serialize($this->configFiles)); } $cache_rebuild_by = SERVER_NAME . ' (' . getenv('REMOTE_ADDR') . ') - ' . adodb_date('d/m/Y H:i:s'); - $conn->Query('REPLACE ' . TABLE_PREFIX . 'Cache (VarName, Data, Cached) VALUES ("last_cache_rebuild", ' . $conn->qstr($cache_rebuild_by) . ', ' . adodb_mktime() . ')'); + $this->Application->setDBCache('last_cache_rebuild', $cache_rebuild_by); unset($this->configFiles); } function RestoreParsedData() { $conn =& $this->Application->GetADODBConnection(); - if (!isset($this->Application->Memcached) || !($data = $this->Application->Memcached->get('master:configs_parsed'))) { - $data = $conn->GetOne('SELECT Data FROM '.TABLE_PREFIX.'Cache WHERE VarName = "configs_parsed"'); + + if ($this->Application->isCachingType(CACHING_TYPE_MEMORY)) { + $data = $this->Application->getCache('master:configs_parsed', false); } + else { + $data = $this->Application->getDBCache('configs_parsed'); + } + if ($data) { $cache = unserialize($data); $this->Application->Factory->Files = $cache['Factory.Files']; @@ -181,16 +191,21 @@ function ResetParsedData($include_sections = false) { $conn =& $this->Application->GetADODBConnection(); - $conn->Query('DELETE FROM '.TABLE_PREFIX.'Cache WHERE VarName = "configs_parsed"'); - if (isset($this->Application->Memcached)) { - $this->Application->Memcached->delete('master:configs_parsed'); + + if ($this->Application->isCachingType(CACHING_TYPE_MEMORY)) { + $this->Application->deleteCache('master:configs_parsed'); } + else { + $this->Application->deleteDBCache('configs_parsed'); + } if ($include_sections) { - $conn->Query('DELETE FROM '.TABLE_PREFIX.'Cache WHERE VarName = "sections_parsed"'); - if (isset($this->Application->Memcached)) { - $this->Application->Memcached->delete('master:sections_parsed'); + if ($this->Application->isCachingType(CACHING_TYPE_MEMORY)) { + $this->Application->deleteCache('master:sections_parsed'); } + else { + $this->Application->deleteDBCache('sections_parsed'); + } } } @@ -273,10 +288,12 @@ { $this->Application->refreshModuleInfo(); - $conn =& $this->Application->GetADODBConnection(); - if (!isset($this->Application->Memcached) || !($data = $this->Application->Memcached->get('master:config_files'))) { - $data = $conn->GetOne('SELECT Data FROM ' . TABLE_PREFIX . 'Cache WHERE VarName = "config_files"'); + if ($this->Application->isCachingType(CACHING_TYPE_MEMORY)) { + $data = $this->Application->getCache('master:config_files', false); } + else { + $data = $this->Application->getDBCache('config_files'); + } if ($cache && $data) { $this->configFiles = unserialize($data);