aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-01-18 21:42:30 +0100
committerJoas Schilling <nickvergessen@gmx.de>2014-01-18 21:42:30 +0100
commit45ab32bf61b9c639b7bb3374ab3226377f79c419 (patch)
treec3ec772f2e84dd13a7e2faefa53c58a2e0c7a579
parentdea91108feac4d0d9bf9c67548764527119e579c (diff)
parent405f883437e248801f3c7d15766a035be53f38ce (diff)
downloadforums-45ab32bf61b9c639b7bb3374ab3226377f79c419.tar
forums-45ab32bf61b9c639b7bb3374ab3226377f79c419.tar.gz
forums-45ab32bf61b9c639b7bb3374ab3226377f79c419.tar.bz2
forums-45ab32bf61b9c639b7bb3374ab3226377f79c419.tar.xz
forums-45ab32bf61b9c639b7bb3374ab3226377f79c419.zip
Merge remote-tracking branch 'EXreaction/ticket/11902' into develop
* EXreaction/ticket/11902: [ticket/11902] Use phpbb\php\ini class [ticket/11902] Prevent errors if set_time_limit disabled [ticket/11902] Set max execution time to 0 in db update
-rw-r--r--phpBB/install/database_update.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index b79420ab71..bad51e2fe3 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -203,7 +203,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())
{