[ticket/16292] Check that the installer container is available

PHPBB3-16292
This commit is contained in:
Patrick Webster 2021-05-03 17:29:52 -05:00
parent 62a45d86ec
commit e22f431660

View file

@ -93,18 +93,22 @@ function installer_msg_handler($errno, $msg_text, $errfile, $errline)
case E_USER_ERROR: case E_USER_ERROR:
$msg = '<b>General Error:</b><br>' . $msg_text . '<br> in file ' . $errfile . ' on line ' . $errline . '<br><br>'; $msg = '<b>General Error:</b><br>' . $msg_text . '<br> in file ' . $errfile . ' on line ' . $errline . '<br><br>';
try if (!empty($phpbb_installer_container))
{ {
/** @var \phpbb\install\helper\iohandler\iohandler_interface $iohandler */ try
$iohandler = $phpbb_installer_container->get('installer.helper.iohandler'); {
$iohandler->add_error_message($msg); /** @var \phpbb\install\helper\iohandler\iohandler_interface $iohandler */
$iohandler->send_response(true); $iohandler = $phpbb_installer_container->get('installer.helper.iohandler');
exit(); $iohandler->add_error_message($msg);
} $iohandler->send_response(true);
catch (\phpbb\install\helper\iohandler\exception\iohandler_not_implemented_exception $e) exit();
{ }
throw new \phpbb\exception\runtime_exception($msg); catch (\phpbb\install\helper\iohandler\exception\iohandler_not_implemented_exception $e)
{
throw new \phpbb\exception\runtime_exception($msg);
}
} }
throw new \phpbb\exception\runtime_exception($msg);
break; break;
case E_DEPRECATED: case E_DEPRECATED:
return true; return true;