1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 08:47:45 +02:00

[ticket/11415] Move while loop from ext manager to acp_extensions.php

Now enable_step works as it's supposed to (do one step at a time) and
less refreshes are required for the user.

PHPBB3-11415
This commit is contained in:
Nathaniel Guse
2013-05-01 13:00:43 -05:00
parent c182ab0e7b
commit 9db4e856db
2 changed files with 28 additions and 27 deletions

View File

@@ -546,22 +546,11 @@ class phpbb_extension_manager
$migrations = $finder->get_classes_from_files($migrations);
$this->migrator->set_migrations($migrations);
// What is a safe limit of execution time? Half the max execution time should be safe.
$safe_time_limit = (ini_get('max_execution_time') / 2);
$start_time = time();
if ($mode == 'enable')
{
while (!$this->migrator->finished())
{
$this->migrator->update();
$this->migrator->update();
// Are we approaching the time limit? If so we want to pause the update and continue after refreshing
if ((time() - $start_time) >= $safe_time_limit)
{
return false;
}
}
return $this->migrator->finished();
}
else if ($mode == 'purge')
{
@@ -571,11 +560,7 @@ class phpbb_extension_manager
{
$this->migrator->revert($migration);
// Are we approaching the time limit? If so we want to pause the update and continue after refreshing
if ((time() - $start_time) >= $safe_time_limit)
{
return false;
}
return false;
}
}
}