Index: branches/RC/core/kernel/utility/unit_config_reader.php =================================================================== diff -u -N -r10459 -r10580 --- branches/RC/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 10459) +++ branches/RC/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 10580) @@ -49,6 +49,9 @@ 'UseOutputCompression', 'OutputCompressionLevel', 'KeepSessionOnBrowserClose', + 'Config_Server_Time', + 'Config_Site_Time', + 'UseChangeLog', ); foreach ($config_vars as $var) { @@ -76,17 +79,25 @@ ); $conn =& $this->Application->GetADODBConnection(); - $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().')'); + if (isset($this->Application->Memcached)) { + $this->Application->Memcached->set('master:configs_parsed', serialize($cache)); + $this->Application->Memcached->set('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().')'); + } unset($this->configFiles); } function RestoreParsedData() { $conn =& $this->Application->GetADODBConnection(); - $data = $conn->GetRow('SELECT Data, Cached FROM '.TABLE_PREFIX.'Cache WHERE VarName = "configs_parsed"'); - if ($data && $data['Cached'] > 0 ) { - $cache = unserialize($data['Data']); + 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 ($data) { + $cache = unserialize($data); $this->Application->Factory->Files = $cache['Factory.Files']; $this->Application->Factory->realClasses = $cache['Factory.realClasses']; $this->Application->Factory->Dependencies = $cache['Factory.Dependencies']; @@ -121,9 +132,15 @@ { $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 ($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'); + } } } @@ -179,11 +196,12 @@ $this->Application->refreshModuleInfo(); $conn =& $this->Application->GetADODBConnection(); - $data = $conn->GetRow('SELECT Data, Cached FROM '.TABLE_PREFIX.'Cache WHERE VarName = "config_files"'); + 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 ($cache && $data) { - $this->configFiles = unserialize($data['Data']); + $this->configFiles = unserialize($data); shuffle($this->configFiles); - $files_cached = $data['Cached']; } else { $this->findConfigFiles($folderPath); // search from base directory