From 16bdd76be162bd7d738290f9498fc70f7886d1ac Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 19 Dec 2024 20:07:37 +0000 Subject: [PATCH] Create PSR-7 request --- index.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index d3483cb7cd..a9d4135b16 100644 --- a/index.php +++ b/index.php @@ -15,11 +15,13 @@ if (!file_exists(__DIR__ . '/vendor/autoload.php')) { require __DIR__ . '/vendor/autoload.php'; +$request = \GuzzleHttp\Psr7\ServerRequest::fromGlobals(); + $dice = (new Dice())->addRules(include __DIR__ . '/static/dependencies.config.php'); /** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */ $addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class); $dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies')); -$dice = $dice->addRule(Friendica\App\Mode::class, ['call' => [['determineRunMode', [false, $_SERVER], Dice::CHAIN_CALL]]]); +$dice = $dice->addRule(Friendica\App\Mode::class, ['call' => [['determineRunMode', [false, $request->getServerParams()], Dice::CHAIN_CALL]]]); \Friendica\DI::init($dice); @@ -36,7 +38,7 @@ $a->runFrontend( $dice->create(\Friendica\App\Page::class), $dice->create(\Friendica\Content\Nav::class), $dice->create(Friendica\Module\Special\HTTPException::class), - new \Friendica\Util\HTTPInputData($_SERVER), + new \Friendica\Util\HTTPInputData($request->getServerParams()), $start_time, - $_SERVER + $request->getServerParams() );