summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2018-09-11 23:45:13 +0100
committerGreg Roach <fisharebest@webtrees.net>2018-09-11 23:45:13 +0100
commitce74398d0d47feb799ee3e3000256dbe11b634db (patch)
treea16abbc33fecde3440db0947da636687c84aac95 /index.php
parentcb63a60ec25218d0f60e4b9099e2b63da6d3eab5 (diff)
downloadwebtrees-ce74398d0d47feb799ee3e3000256dbe11b634db.tar.gz
webtrees-ce74398d0d47feb799ee3e3000256dbe11b634db.tar.bz2
webtrees-ce74398d0d47feb799ee3e3000256dbe11b634db.zip
Fix: #1892 - create a service for handling timeouts with long-running processes
Diffstat (limited to 'index.php')
-rw-r--r--index.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/index.php b/index.php
index 3f4db064de..69a8eb344e 100644
--- a/index.php
+++ b/index.php
@@ -30,6 +30,7 @@ use Fisharebest\Webtrees\Http\Middleware\CheckForMaintenanceMode;
use Fisharebest\Webtrees\Http\Middleware\Housekeeping;
use Fisharebest\Webtrees\Http\Middleware\PageHitCounter;
use Fisharebest\Webtrees\Http\Middleware\UseTransaction;
+use Fisharebest\Webtrees\Services\TimeoutService;
use League\Flysystem\Adapter\Local;
use League\Flysystem\Filesystem;
use PDOException;
@@ -74,9 +75,6 @@ define('WT_EVENTS_DIV', 'DIV|ANUL|_SEPR');
define('WT_ROOT', __DIR__ . DIRECTORY_SEPARATOR);
-// Keep track of time so we can handle timeouts gracefully.
-define('WT_START_TIME', microtime(true));
-
// We want to know about all PHP errors during development, and fewer in production.
if (WT_DEBUG) {
error_reporting(E_ALL | E_STRICT | E_NOTICE | E_DEPRECATED);
@@ -260,6 +258,7 @@ try {
$resolver->bind(Tree::class, $tree);
$resolver->bind(User::class, Auth::user());
$resolver->bind(LocaleInterface::class, Locale::create(WT_LOCALE));
+ $resolver->bind(TimeoutService::class, new TimeoutService(microtime(true)));
$controller = $resolver->resolve($controller_class);