diff --git a/phpBB/install/startup.php b/phpBB/install/startup.php index 94091f1beb..7c0ce5ecd2 100644 --- a/phpBB/install/startup.php +++ b/phpBB/install/startup.php @@ -151,7 +151,57 @@ function installer_shutdown_function($display_errors) } else if ($error['type'] & $supported_error_levels) { - trigger_error($error['message'], $error['type']); + // Convert core errors to user warnings for trigger_error() + if ($error['type'] == E_CORE_ERROR || $error['type'] == E_COMPILE_ERROR) + { + $error['type'] = E_USER_ERROR; + } + else if ($error['type'] == E_CORE_WARNING) + { + $error['type'] = E_USER_WARNING; + } + + try + { + installer_msg_handler($error['type'], $error['message'], $error['file'], $error['line']); + } + catch (\phpbb\exception\runtime_exception $exception) + { + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo 'General Error'; + echo ''; + echo ''; + echo ''; + echo '
'; + echo '
'; + echo '
'; + echo '
'; + echo '

General Error

'; + + echo '
' . $exception->getMessage() . '
'; + + echo '
'; + echo '
'; + echo '
'; + echo ' '; + echo '
'; + echo ''; + echo ''; + } } } } @@ -177,7 +227,10 @@ phpbb_require_updated('includes/utf/utf_tools.' . $phpEx, $phpbb_root_path); set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'installer_msg_handler'); $php_ini = new \bantu\IniGetWrapper\IniGetWrapper(); -register_shutdown_function('installer_shutdown_function', $php_ini->getNumeric('display_errors')); +$ini_display_errors = $php_ini->getNumeric('display_errors'); +register_shutdown_function('installer_shutdown_function', $ini_display_errors); +// Suppress errors until we have created the containers +@ini_set('display_errors', 0); $phpbb_installer_container_builder = new \phpbb\di\container_builder($phpbb_root_path, $phpEx); $phpbb_installer_container_builder @@ -191,3 +244,5 @@ $phpbb_installer_container = $phpbb_installer_container_builder ->with_config_path($config_path) ->with_custom_parameters(array('cache.driver.class' => 'phpbb\cache\driver\file')) ->get_container(); + +@ini_set('display_errors', $ini_display_errors);