mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-01 14:30:32 +02:00
[ticket/14462] Further speed improvements
- Cache the secondary container - Only initialize tasks/modules that are being used - Add timeout error message in the AJAX UI PHPBB3-14462
This commit is contained in:
@@ -129,7 +129,6 @@ class create_config_file extends \phpbb\install\task_base
|
||||
else
|
||||
{
|
||||
$this->iohandler->add_error_message('UNABLE_TO_WRITE_CONFIG_FILE');
|
||||
$this->iohandler->send_response();
|
||||
throw new user_interaction_required_exception();
|
||||
}
|
||||
|
||||
@@ -139,7 +138,6 @@ class create_config_file extends \phpbb\install\task_base
|
||||
{
|
||||
// We were unable to create the lock file - abort
|
||||
$this->iohandler->add_error_message('UNABLE_TO_WRITE_LOCK');
|
||||
$this->iohandler->send_response();
|
||||
throw new user_interaction_required_exception();
|
||||
}
|
||||
@fclose($fp);
|
||||
|
@@ -136,7 +136,6 @@ class obtain_admin_data extends \phpbb\install\task_base implements \phpbb\insta
|
||||
$this->io_handler->add_user_form_group('ADMIN_CONFIG', $admin_form);
|
||||
|
||||
// Require user interaction
|
||||
$this->io_handler->send_response();
|
||||
throw new user_interaction_required_exception();
|
||||
}
|
||||
|
||||
|
@@ -164,7 +164,6 @@ class obtain_board_data extends \phpbb\install\task_base implements \phpbb\insta
|
||||
|
||||
$this->io_handler->add_user_form_group('BOARD_CONFIG', $board_form);
|
||||
|
||||
$this->io_handler->send_response();
|
||||
throw new user_interaction_required_exception();
|
||||
}
|
||||
|
||||
|
@@ -188,7 +188,6 @@ class obtain_database_data extends \phpbb\install\task_base implements \phpbb\in
|
||||
$this->io_handler->add_user_form_group('DB_CONFIG', $database_form);
|
||||
|
||||
// Require user interaction
|
||||
$this->io_handler->send_response();
|
||||
throw new user_interaction_required_exception();
|
||||
}
|
||||
|
||||
|
@@ -144,7 +144,6 @@ class obtain_email_data extends \phpbb\install\task_base implements \phpbb\insta
|
||||
|
||||
$this->io_handler->add_user_form_group('EMAIL_CONFIG', $email_form);
|
||||
|
||||
$this->io_handler->send_response();
|
||||
throw new user_interaction_required_exception();
|
||||
}
|
||||
}
|
||||
|
@@ -115,7 +115,6 @@ class obtain_file_updater_method extends task_base
|
||||
),
|
||||
));
|
||||
|
||||
$this->iohandler->send_response();
|
||||
throw new user_interaction_required_exception();
|
||||
}
|
||||
}
|
||||
|
@@ -180,7 +180,6 @@ class obtain_server_data extends \phpbb\install\task_base implements \phpbb\inst
|
||||
|
||||
$this->io_handler->add_user_form_group('SERVER_CONFIG', $server_form);
|
||||
|
||||
$this->io_handler->send_response();
|
||||
throw new user_interaction_required_exception();
|
||||
}
|
||||
}
|
||||
|
@@ -141,7 +141,6 @@ class obtain_update_ftp_data extends task_base
|
||||
),
|
||||
));
|
||||
|
||||
$this->iohandler->send_response();
|
||||
throw new user_interaction_required_exception();
|
||||
}
|
||||
}
|
||||
|
@@ -93,7 +93,6 @@ class obtain_update_settings extends task_base
|
||||
),
|
||||
));
|
||||
|
||||
$this->iohandler->send_response();
|
||||
throw new user_interaction_required_exception();
|
||||
}
|
||||
}
|
||||
|
@@ -13,7 +13,6 @@
|
||||
|
||||
namespace phpbb\install\module\requirements;
|
||||
|
||||
use phpbb\install\exception\resource_limit_reached_exception;
|
||||
use phpbb\install\exception\user_interaction_required_exception;
|
||||
use phpbb\install\module_base;
|
||||
|
||||
@@ -25,41 +24,8 @@ abstract class abstract_requirements_module extends module_base
|
||||
public function run()
|
||||
{
|
||||
$tests_passed = true;
|
||||
|
||||
// Recover install progress
|
||||
$task_name = $this->recover_progress();
|
||||
$task_found = false;
|
||||
|
||||
/**
|
||||
* @var string $name ID of the service
|
||||
* @var \phpbb\install\task_interface $task Task object
|
||||
*/
|
||||
foreach ($this->task_collection as $name => $task)
|
||||
{
|
||||
// Run until there are available resources
|
||||
if ($this->install_config->get_time_remaining() <= 0 || $this->install_config->get_memory_remaining() <= 0)
|
||||
{
|
||||
throw new resource_limit_reached_exception();
|
||||
}
|
||||
|
||||
// Skip forward until the next task is reached
|
||||
if (!$task_found)
|
||||
{
|
||||
if ($name === $task_name || empty($task_name))
|
||||
{
|
||||
$task_found = true;
|
||||
|
||||
if ($name === $task_name)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if we can run the task
|
||||
if (!$task->is_essential() && !$task->check_requirements())
|
||||
{
|
||||
@@ -76,7 +42,7 @@ abstract class abstract_requirements_module extends module_base
|
||||
}
|
||||
|
||||
// Module finished, so clear task progress
|
||||
$this->install_config->set_finished_task('');
|
||||
$this->install_config->set_finished_task(0);
|
||||
|
||||
// Check if tests have failed
|
||||
if (!$tests_passed)
|
||||
@@ -91,7 +57,6 @@ abstract class abstract_requirements_module extends module_base
|
||||
));
|
||||
|
||||
// Send the response and quit
|
||||
$this->iohandler->send_response();
|
||||
throw new user_interaction_required_exception();
|
||||
}
|
||||
}
|
||||
|
@@ -158,7 +158,6 @@ class update extends task_base
|
||||
array_unshift($msg, $e->getMessage());
|
||||
|
||||
$this->iohandler->add_error_message($msg);
|
||||
$this->iohandler->send_response();
|
||||
throw new user_interaction_required_exception();
|
||||
}
|
||||
|
||||
|
@@ -101,7 +101,6 @@ class download_updated_files extends task_base
|
||||
),
|
||||
));
|
||||
|
||||
$this->iohandler->send_response();
|
||||
throw new user_interaction_required_exception();
|
||||
}
|
||||
}
|
||||
|
@@ -136,7 +136,6 @@ class show_file_status extends task_base
|
||||
));
|
||||
|
||||
// Show results to the user
|
||||
$this->iohandler->send_response();
|
||||
throw new user_interaction_required_exception();
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user