diff options
Diffstat (limited to 'phpBB/install/database_update.php')
-rw-r--r-- | phpBB/install/database_update.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index b79420ab71..6c9eeb6a75 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -169,6 +169,8 @@ header('Content-type: text/html; charset=UTF-8'); <?php +define('IN_DB_UPDATE', true); + /** * @todo firebird/mysql update? */ @@ -203,7 +205,15 @@ $migrations = $finder $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); +// No more than 15 seconds so the user isn't sitting and waiting for a very long time +$phpbb_ini = new \phpbb\php\ini(); +$safe_time_limit = min(15, ($phpbb_ini->get_int('max_execution_time') / 2)); + +// While we're going to try limit this to half the max execution time, +// we want to try and take additional measures to prevent hitting the +// max execution time (if, say, one migration step takes much longer +// than the max execution time) +@set_time_limit(0); while (!$migrator->finished()) { |