Fix update_all_modules.php not calling all the update routines of the Install module

This commit is contained in:
Kijin Sung 2023-08-11 01:38:28 +09:00
parent 2219a77fb2
commit 4d4d454af0

View file

@ -28,7 +28,7 @@ foreach($module_list as $key => $value)
} }
// Install all modules. // Install all modules.
$oInstallController = getController('install'); $oInstallController = InstallController::getInstance();
foreach ($need_install as $module) foreach ($need_install as $module)
{ {
try try
@ -38,22 +38,21 @@ foreach ($need_install as $module)
} }
catch (\Exception $e) catch (\Exception $e)
{ {
// pass echo 'Error: ' . $e->getMessage() . PHP_EOL;
} }
} }
// Update all modules. // Update all modules.
$oInstallAdminController = getAdminController('install');
foreach ($need_update as $module) foreach ($need_update as $module)
{ {
echo 'Updating ' . $module . '...' . PHP_EOL; try
$oModule = ModuleModel::getModuleInstallClass($module);
if (is_object($oModule) && method_exists($oModule, 'checkUpdate') && method_exists($oModule, 'moduleUpdate'))
{ {
if ($oModule->checkUpdate()) echo 'Updating ' . $module . '...' . PHP_EOL;
{ $oInstallController->updateModule($module);
return $oModule->moduleUpdate(); }
} catch (\Exception $e)
{
echo 'Error: ' . $e->getMessage() . PHP_EOL;
} }
} }