Index: branches/5.2.x/core/install.php =================================================================== diff -u -N -r14692 -r14699 --- branches/5.2.x/core/install.php (.../install.php) (revision 14692) +++ branches/5.2.x/core/install.php (.../install.php) (revision 14699) @@ -1,6 +1,6 @@ ScanModules(); foreach ($modules as $module_path) { - $contants_file = MODULES_PATH . '/' . $module_path . '/constants.php'; + $constants_file = MODULES_PATH . '/' . $module_path . '/constants.php'; - if ( file_exists($contants_file) ) { - kUtil::includeOnce($contants_file); + if ( file_exists($constants_file) ) { + kUtil::includeOnce($constants_file); } } } @@ -1392,23 +1392,14 @@ { static $modules = null; - if (!isset($modules)) { - $modules = Array(); - $fh = opendir(MODULES_PATH); - while ( ($sub_folder = readdir($fh)) ) { - $folder_path = MODULES_PATH . '/'.$sub_folder; - if ($sub_folder != '.' && $sub_folder != '..' && is_dir($folder_path)) { - // this is folder in MODULES_PATH directory - if (file_exists($folder_path.'/install.php') && file_exists($folder_path.'/install/install_schema.sql')) { - $install_order = trim( file_get_contents($folder_path . '/install/install_order.txt') ); - $modules[$install_order] = $sub_folder; - } - } - } + if ( !isset($modules) ) { + // use direct include, because it's called before kApplication::Init, that creates class factory + kUtil::includeOnce( KERNEL_PATH . kApplication::MODULE_HELPER_PATH ); + + $modules_helper = new kModulesHelper(); + $modules = $modules_helper->getModules(); } - // allows to control module install order - ksort($modules, SORT_NUMERIC); return $modules; }