From f4f0ff0eec78c85b4ec2962a0de06d9aa2bd37a5 Mon Sep 17 00:00:00 2001 From: Mate Bartus Date: Mon, 17 Aug 2015 18:38:07 +0200 Subject: [ticket/14097] Improve error and failure handling in the installer PHPBB3-14097 --- phpBB/phpbb/install/installer.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/install/installer.php') diff --git a/phpBB/phpbb/install/installer.php b/phpBB/phpbb/install/installer.php index cb4ddb8783..78a0de0241 100644 --- a/phpBB/phpbb/install/installer.php +++ b/phpBB/phpbb/install/installer.php @@ -92,7 +92,8 @@ class installer $module_found = false; // Variable used to check if the install process have been finished - $install_finished = false; + $install_finished = false; + $fail_cleanup = false; // We are installing something, so the introduction stage can go now... $this->install_config->set_finished_navigation_stage(array('install', 0, 'introduction')); @@ -209,6 +210,13 @@ class installer { // Do nothing } + catch (\Exception $e) + { + // Most likely there were a PHP failure, so let's die like a gentleman + $this->iohandler->add_error_message($e->getMessage()); + $this->iohandler->send_response(); + $fail_cleanup = true; + } if ($install_finished) { @@ -223,7 +231,7 @@ class installer // Save install progress try { - if ($install_finished) + if ($install_finished || $fail_cleanup) { $this->install_config->clean_up_config_file(); } -- cgit v1.2.1