]> git.mxchange.org Git - friendica.git/commitdiff
Create PSR-7 request
authorArt4 <art4@wlabs.de>
Thu, 19 Dec 2024 20:07:37 +0000 (20:07 +0000)
committerArt4 <art4@wlabs.de>
Thu, 19 Dec 2024 20:07:37 +0000 (20:07 +0000)
index.php

index d3483cb7cde6e40b9820519ecc97d068d071c038..a9d4135b16f7f2efd7226a29bada97e7edd97797 100644 (file)
--- 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()
 );