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') 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 From dd1b777ca779b60b3624e90a9c7a6831fbddf7c4 Mon Sep 17 00:00:00 2001 From: Mate Bartus Date: Mon, 17 Aug 2015 20:24:01 +0200 Subject: [ticket/14097] Remove auto refresh on install failure PHPBB3-14097 --- phpBB/phpbb/install/installer.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'phpBB/phpbb/install') diff --git a/phpBB/phpbb/install/installer.php b/phpBB/phpbb/install/installer.php index 78a0de0241..755edb5297 100644 --- a/phpBB/phpbb/install/installer.php +++ b/phpBB/phpbb/install/installer.php @@ -212,7 +212,6 @@ class installer } 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; @@ -223,7 +222,7 @@ class installer // Send install finished message $this->iohandler->set_progress('INSTALLER_FINISHED', $this->install_config->get_task_progress_count()); } - else + else if (!$fail_cleanup) { $this->iohandler->request_refresh(); } -- cgit v1.2.1