Index: trunk/core/kernel/utility/unit_config_reader.php =================================================================== diff -u -r4794 -r4795 --- trunk/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 4794) +++ trunk/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 4795) @@ -117,22 +117,24 @@ } } - function scanModules($folderPath) + function scanModules($folderPath, $cache=true) { - if (!defined('IS_INSTALL')) { + if (!defined('IS_INSTALL') && $cache) { $restored = $this->RestoreParsedData(); if ($restored) return; } $this->ProcessAllConfigs = true; - $this->includeConfigFiles(); + $this->includeConfigFiles($folderPaths, $cache); $this->ParseConfigs(); $this->CacheParsedData(); - $conn =& $this->Application->GetADODBConnection(); - $conn->Query('REPLACE '.TABLE_PREFIX.'Cache (VarName, Data, Cached) VALUES ("config_files", '.$conn->qstr(serialize($this->configFiles)).', '.adodb_mktime().')'); + if ($cache) { + $conn =& $this->Application->GetADODBConnection(); + $conn->Query('REPLACE '.TABLE_PREFIX.'Cache (VarName, Data, Cached) VALUES ("config_files", '.$conn->qstr(serialize($this->configFiles)).', '.adodb_mktime().')'); + } unset($this->configFiles); } @@ -160,19 +162,19 @@ } } - function includeConfigFiles() + function includeConfigFiles($folderPath, $cache=true) { $this->Application->refreshModuleInfo(); $conn =& $this->Application->GetADODBConnection(); $data = $conn->GetRow('SELECT Data, Cached FROM '.TABLE_PREFIX.'Cache WHERE VarName = "config_files"'); - if ($data && $data['Cached'] > 0 ) { + if ($cache && $data) { $this->configFiles = unserialize($data['Data']); sort($this->configFiles); $files_cached = $data['Cached']; } else { - $this->findConfigFiles(''); // search from base directory + $this->findConfigFiles($folderPath); // search from base directory } foreach ($this->configFiles as $filename) @@ -224,7 +226,7 @@ if ($prefix == 'formatters') { echo ''; } - + $register_classes = getArrayValue($config,'RegisterClasses'); if (!$register_classes) $register_classes = Array(); $class_params=Array('ItemClass','ListClass','EventHandlerClass','TagProcessorClass'); @@ -422,10 +424,11 @@ $file = $this->prefixFiles[$prefix]; $prefix = $this->PreloadConfigFile($file); - $this->postProcessConfig($prefix, 'AggregateConfigs', 'sub_prefix'); - $clones = $this->postProcessConfig($prefix, 'Clones', 'prefix'); + $clones = $this->postProcessConfig($prefix, 'AggregateConfigs', 'sub_prefix'); + $clones = array_merge($this->postProcessConfig($prefix, 'Clones', 'prefix'), $clones); array_unshift($clones, $prefix); + $clones = array_unique($clones); foreach ($clones as $a_prefix) { $this->Application->HandleEvent( new kEvent($a_prefix.':OnAfterConfigRead') ); }