Index: branches/5.2.x/core/kernel/utility/unit_config_reader.php =================================================================== diff -u -N -r16300 -r16437 --- branches/5.2.x/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 16300) +++ branches/5.2.x/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 16437) @@ -1,6 +1,6 @@ _directorySeparator = preg_quote(DIRECTORY_SEPARATOR); - $editor_path = explode('/', trim(EDITOR_PATH, '/')); - $this->_skipFolders[] = array_pop($editor_path); // last of cmseditor folders + $this->_skipFolders[] = basename(EDITOR_PATH); $this->_moduleFolderRegExp = '#' . $this->_directorySeparator . '(core|modules' . $this->_directorySeparator . '.*?)' . $this->_directorySeparator . '#'; } @@ -146,30 +145,27 @@ function findConfigFiles($folderPath, $level = 0) { - // if FULL_PATH = "/" ensure, that all "/" in $folderPath are not deleted + // If FULL_PATH = "/" ensure, that all "/" in $folderPath are not deleted. $reg_exp = '/^' . preg_quote(FULL_PATH, '/') . '/'; - $folderPath = preg_replace($reg_exp, '', $folderPath, 1); // this make sense, since $folderPath may NOT contain FULL_PATH + // This make sense, since $folder_path may NOT contain FULL_PATH. + $folderPath = preg_replace($reg_exp, '', $folderPath, 1); + $base_folder = FULL_PATH . $folderPath . DIRECTORY_SEPARATOR; $sub_folders = glob($base_folder . '*', GLOB_ONLYDIR); if (!$sub_folders) { return ; } - if ($level == 0) { - // don't scan Front-End themes because of extensive directory structure - $sub_folders = array_diff($sub_folders, Array ($base_folder . 'themes', $base_folder . 'tools')); - } - foreach ($sub_folders as $full_path) { $sub_folder = substr($full_path, strlen($base_folder)); if (in_array($sub_folder, $this->_skipFolders)) { continue; } - if (preg_match('/^\./', $sub_folder)) { - // don't scan ".folders" + if (substr($sub_folder, 0, 1) == '.') { + // Don't scan ".folders". continue; } @@ -212,9 +208,20 @@ } } else { - $this->findConfigFiles(FULL_PATH . DIRECTORY_SEPARATOR . 'core'); // search from core directory - $this->findConfigFiles($folderPath); // search from modules directory + /*if ( $this->Application->isDebugMode() ) { + $this->Application->Debugger->profileStart('fcf'); + }*/ + $this->findConfigFiles(FULL_PATH . DIRECTORY_SEPARATOR . 'core'); // Search from core directory. + $this->findConfigFiles($folderPath); // Search from modules directory. + + /*if ( $this->Application->isDebugMode() ) { + $this->Application->Debugger->profileFinish( + 'fcf', + 'findConfigFiles [' . count($this->configFiles) . ']' + ); + }*/ + if ( $cache ) { if ( $this->Application->isCachingType(CACHING_TYPE_MEMORY) ) { $this->Application->setCache('master:config_files', serialize($this->configFiles)); Index: branches/5.2.x/index.php =================================================================== diff -u -N -r16436 -r16437 --- branches/5.2.x/index.php (.../index.php) (revision 16436) +++ branches/5.2.x/index.php (.../index.php) (revision 16437) @@ -1,6 +1,6 @@