Skip to content

Commit a9a07be

Browse files
committed
Fixed _registerAppModules() include_once issue
1 parent f4cb977 commit a9a07be

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

framework/Apphp.php

+16-14
Original file line numberDiff line numberDiff line change
@@ -1217,23 +1217,25 @@ protected function _registerAppHelpers()
12171217
*/
12181218
protected function _registerAppModules()
12191219
{
1220-
$modules = CConfig::get('modules');
1221-
if (!is_array($modules)) return false;
1220+
$modules = CConfig::get('modules');
1221+
if(!is_array($modules)) return false;
12221222

1223-
foreach ($modules as $id => $module) {
1224-
$enable = isset($module['enable']) ? (bool)$module['enable'] : false;
1225-
if ($enable) {
1226-
$moduleName = strtolower($id);
1227-
$moduleConfig = APPHP_PATH . DS . 'protected' . DS . 'modules' . DS . $moduleName . DS . 'config' . DS . 'main.php';
1228-
if (file_exists($moduleConfig)) {
1229-
$arrConfig = include_once($moduleConfig);
1230-
self::$_appModules[$moduleName] = $arrConfig;
1231-
}
1232-
}
1233-
}
1223+
foreach($modules as $id => $module){
1224+
$enable = isset($module['enable']) ? (bool)$module['enable'] : false;
1225+
if($enable){
1226+
$moduleName = strtolower($id);
1227+
$moduleConfig = APPHP_PATH.DS.'protected'.DS.'modules'.DS.$moduleName.DS.'config'.DS.'main.php';
1228+
if(file_exists($moduleConfig)){
1229+
$arrConfig = include($moduleConfig);
1230+
if (is_array($arrConfig)) {
1231+
self::$_appModules[$moduleName] = $arrConfig;
1232+
}
1233+
}
1234+
}
1235+
}
1236+
12341237
return true;
12351238
}
1236-
12371239
}
12381240

12391241

0 commit comments

Comments
 (0)