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() );