1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/13740] Add backend support for install progress tracking

PHPBB3-13740
This commit is contained in:
MateBartus
2015-06-02 21:56:27 +02:00
committed by Mate Bartus
parent 4df89d8848
commit 37b0134aa4
24 changed files with 306 additions and 22 deletions

View File

@@ -30,6 +30,11 @@ class installer
*/
protected $installer_modules;
/**
* @var \phpbb\install\helper\iohandler\iohandler_interface
*/
protected $iohandler;
/**
* Constructor
*
@@ -58,6 +63,16 @@ class installer
$this->installer_modules = $modules;
}
/**
* Sets input-output handler objects
*
* @param helper\iohandler\iohandler_interface $iohandler
*/
public function set_iohandler(\phpbb\install\helper\iohandler\iohandler_interface $iohandler)
{
$this->iohandler = $iohandler;
}
/**
* Run phpBB installer
*/
@@ -69,6 +84,20 @@ class installer
// Recover install progress
$module_index = $this->recover_progress();
// Count all tasks in the current installer modules
$task_count = 0;
foreach ($this->installer_modules as $name)
{
/** @var \phpbb\install\module_interface $module */
$module = $this->container->get($name);
$task_count += $module->get_task_count();
}
// Set task count
$this->install_config->set_task_progress_count($task_count);
$this->iohandler->set_task_count($task_count);
$install_finished = false;
try
@@ -107,11 +136,12 @@ class installer
if ($install_finished)
{
die ("install finished");
// Send install finished message
$this->iohandler->set_progress('INSTALLER_FINISHED', $this->install_config->get_task_progress_count());
}
else
{
die ("install memory or time limit reached");
// @todo: Send refresh request
}
}
catch (\phpbb\install\exception\user_interaction_required_exception $e)