summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2021-05-04 09:23:18 +0100
committerGreg Roach <fisharebest@gmail.com>2021-05-04 09:23:18 +0100
commit00c45d2300a5375d4779bf9dbe157d4ef56b9443 (patch)
tree227fee1ab9ef7d96d85af0d46e6453214bd5326c /index.php
parent56afe05fa72eb037740c3a05c02828a7ba30f9a9 (diff)
downloadwebtrees-00c45d2300a5375d4779bf9dbe157d4ef56b9443.tar.gz
webtrees-00c45d2300a5375d4779bf9dbe157d4ef56b9443.tar.bz2
webtrees-00c45d2300a5375d4779bf9dbe157d4ef56b9443.zip
Revert "Move PSR17 factories to the registry"
This reverts commit 56afe05fa72eb037740c3a05c02828a7ba30f9a9.
Diffstat (limited to 'index.php')
-rw-r--r--index.php19
1 files changed, 7 insertions, 12 deletions
diff --git a/index.php b/index.php
index bd249be718..e63958716f 100644
--- a/index.php
+++ b/index.php
@@ -40,23 +40,18 @@ if (PHP_SAPI === 'cli-server') {
}
// Create the application.
-$webtrees = new Webtrees();
-$webtrees->registerErrorHandler();
-$webtrees->registerFactories();
+$application = new Webtrees();
+$application->bootstrap();
+
+// Select a PSR message factory.
+$application->selectMessageFactory();
// The application is defined by a stack of middleware and a PSR-11 container.
-$middleware = $webtrees->middleware();
+$middleware = $application->middleware();
$container = app();
$dispatcher = new Dispatcher($middleware, $container);
// Build the request from the PHP super-globals.
-$server_request_creator = new ServerRequestCreator(
- Registry::serverRequestFactory(),
- Registry::uriFactory(),
- Registry::uploadedFileFactory(),
- Registry::streamFactory()
-);
-
-$request = $server_request_creator->fromGlobals();
+$request = app(ServerRequestCreator::class)->fromGlobals();
$dispatcher->dispatch($request);