Index: trunk/core/units/general/helpers/sections_helper.php =================================================================== diff -u -N -r4702 -r4758 --- trunk/core/units/general/helpers/sections_helper.php (.../sections_helper.php) (revision 4702) +++ trunk/core/units/general/helpers/sections_helper.php (.../sections_helper.php) (revision 4758) @@ -5,14 +5,14 @@ * */ class kSectionsHelper extends kHelper { - + /** * Holds information about all sections * * @var Array */ var $Tree = Array(); - + /** * Set's prefix and special * @@ -33,8 +33,21 @@ */ function BuildTree() { + $unit_config_reader = false; + if (defined('CACHE_PARSED_CONFIGS') && CACHE_PARSED_CONFIGS) { + $data = $this->Conn->GetRow('SELECT Data, Cached FROM '.TABLE_PREFIX.'Cache WHERE VarName = "sections_parsed"'); + if ($data) { + $this->Tree = unserialize($data['Data']); + return ; + } + $this->Application->UnitConfigReader->includeConfigFiles(); + } + $this->Tree = Array(); - $unit_config_reader =& $this->Application->recallObject('kUnitConfigReader'); + if (!$unit_config_reader) { + $unit_config_reader =& $this->Application->recallObject('kUnitConfigReader'); + } + $prefixes = array_keys($unit_config_reader->configData); foreach ($prefixes as $prefix) { $config =& $unit_config_reader->configData[$prefix]; @@ -47,9 +60,9 @@ // we could also skip not allowed sections here in future $section_params['SectionPrefix'] = $prefix; $section_params['url']['m_opener'] = 'r'; - + $pass_section = getArrayValue($section_params, 'url', 'pass_section'); - + if ($pass_section) { unset($section_params['url']['pass_section']); $section_params['url']['section'] = $section_name; @@ -73,8 +86,13 @@ } } } + + if (defined('CACHE_PARSED_CONFIGS') && CACHE_PARSED_CONFIGS) { + $this->Conn->Query('REPLACE '.TABLE_PREFIX.'Cache (VarName, Data, Cached) VALUES ("sections_parsed", '.$this->Conn->qstr(serialize($this->Tree)).', '.adodb_mktime().')'); + } + } - + /** * Returns details information about section *