mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-07 18:44:26 +02:00
Refactor dependency for $_SERVER
This commit is contained in:
parent
5803c1e760
commit
c53a75bc38
1 changed files with 16 additions and 16 deletions
|
@ -37,7 +37,7 @@ use Friendica\Model\Log\ParsedLogIterator;
|
||||||
use Friendica\Network;
|
use Friendica\Network;
|
||||||
use Friendica\Util;
|
use Friendica\Util;
|
||||||
|
|
||||||
return (function(): array {
|
return (function(array $serverVars): array {
|
||||||
/**
|
/**
|
||||||
* @var string $basepath The base path of the Friendica installation without trailing slash
|
* @var string $basepath The base path of the Friendica installation without trailing slash
|
||||||
*/
|
*/
|
||||||
|
@ -59,7 +59,7 @@ return (function(): array {
|
||||||
Util\BasePath::class => [
|
Util\BasePath::class => [
|
||||||
'constructParams' => [
|
'constructParams' => [
|
||||||
$basepath,
|
$basepath,
|
||||||
$_SERVER
|
$serverVars,
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
DiceInstanceManager::class => [
|
DiceInstanceManager::class => [
|
||||||
|
@ -95,7 +95,7 @@ return (function(): array {
|
||||||
'call' => [
|
'call' => [
|
||||||
['createConfigFileManager', [
|
['createConfigFileManager', [
|
||||||
$basepath,
|
$basepath,
|
||||||
$_SERVER,
|
$serverVars,
|
||||||
], Dice::CHAIN_CALL],
|
], Dice::CHAIN_CALL],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
@ -107,7 +107,7 @@ return (function(): array {
|
||||||
],
|
],
|
||||||
\Friendica\App\Mode::class => [
|
\Friendica\App\Mode::class => [
|
||||||
'call' => [
|
'call' => [
|
||||||
['determineRunMode', [true, $_SERVER], Dice::CHAIN_CALL],
|
['determineRunMode', [true, $serverVars], Dice::CHAIN_CALL],
|
||||||
['determine', [
|
['determine', [
|
||||||
$basepath,
|
$basepath,
|
||||||
], Dice::CHAIN_CALL],
|
], Dice::CHAIN_CALL],
|
||||||
|
@ -116,7 +116,7 @@ return (function(): array {
|
||||||
\Friendica\Core\Config\Capability\IManageConfigValues::class => [
|
\Friendica\Core\Config\Capability\IManageConfigValues::class => [
|
||||||
'instanceOf' => \Friendica\Core\Config\Model\DatabaseConfig::class,
|
'instanceOf' => \Friendica\Core\Config\Model\DatabaseConfig::class,
|
||||||
'constructParams' => [
|
'constructParams' => [
|
||||||
$_SERVER,
|
$serverVars,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
\Friendica\Core\PConfig\Capability\IManagePersonalConfigValues::class => [
|
\Friendica\Core\PConfig\Capability\IManagePersonalConfigValues::class => [
|
||||||
|
@ -154,13 +154,13 @@ return (function(): array {
|
||||||
*/
|
*/
|
||||||
\Friendica\App\BaseURL::class => [
|
\Friendica\App\BaseURL::class => [
|
||||||
'constructParams' => [
|
'constructParams' => [
|
||||||
$_SERVER,
|
$serverVars,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'$hostname' => [
|
'$hostname' => [
|
||||||
'instanceOf' => \Friendica\App\BaseURL::class,
|
'instanceOf' => \Friendica\App\BaseURL::class,
|
||||||
'constructParams' => [
|
'constructParams' => [
|
||||||
$_SERVER,
|
$serverVars,
|
||||||
],
|
],
|
||||||
'call' => [
|
'call' => [
|
||||||
['getHost', [], Dice::CHAIN_CALL],
|
['getHost', [], Dice::CHAIN_CALL],
|
||||||
|
@ -227,7 +227,7 @@ return (function(): array {
|
||||||
\Friendica\App\Arguments::class => [
|
\Friendica\App\Arguments::class => [
|
||||||
'instanceOf' => \Friendica\App\Arguments::class,
|
'instanceOf' => \Friendica\App\Arguments::class,
|
||||||
'call' => [
|
'call' => [
|
||||||
['determine', [$_SERVER, $_GET], Dice::CHAIN_CALL],
|
['determine', [$serverVars, $_GET], Dice::CHAIN_CALL],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
\Friendica\Core\System::class => [
|
\Friendica\Core\System::class => [
|
||||||
|
@ -237,7 +237,7 @@ return (function(): array {
|
||||||
],
|
],
|
||||||
\Friendica\App\Router::class => [
|
\Friendica\App\Router::class => [
|
||||||
'constructParams' => [
|
'constructParams' => [
|
||||||
$_SERVER,
|
$serverVars,
|
||||||
__DIR__ . '/routes.config.php',
|
__DIR__ . '/routes.config.php',
|
||||||
[Dice::INSTANCE => Dice::SELF],
|
[Dice::INSTANCE => Dice::SELF],
|
||||||
null
|
null
|
||||||
|
@ -245,13 +245,13 @@ return (function(): array {
|
||||||
],
|
],
|
||||||
L10n::class => [
|
L10n::class => [
|
||||||
'constructParams' => [
|
'constructParams' => [
|
||||||
$_SERVER, $_GET
|
$serverVars, $_GET
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
IHandleSessions::class => [
|
IHandleSessions::class => [
|
||||||
'instanceOf' => \Friendica\Core\Session\Factory\Session::class,
|
'instanceOf' => \Friendica\Core\Session\Factory\Session::class,
|
||||||
'call' => [
|
'call' => [
|
||||||
['create', [$_SERVER], Dice::CHAIN_CALL],
|
['create', [$serverVars], Dice::CHAIN_CALL],
|
||||||
['start', [], Dice::CHAIN_CALL],
|
['start', [], Dice::CHAIN_CALL],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
@ -288,12 +288,12 @@ return (function(): array {
|
||||||
],
|
],
|
||||||
\Friendica\Core\Worker\Repository\Process::class => [
|
\Friendica\Core\Worker\Repository\Process::class => [
|
||||||
'constructParams' => [
|
'constructParams' => [
|
||||||
$_SERVER
|
$serverVars
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
\Friendica\App\Request::class => [
|
\Friendica\App\Request::class => [
|
||||||
'constructParams' => [
|
'constructParams' => [
|
||||||
$_SERVER
|
$serverVars
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
\Psr\Clock\ClockInterface::class => [
|
\Psr\Clock\ClockInterface::class => [
|
||||||
|
@ -301,14 +301,14 @@ return (function(): array {
|
||||||
],
|
],
|
||||||
\Friendica\Module\Special\HTTPException::class => [
|
\Friendica\Module\Special\HTTPException::class => [
|
||||||
'constructParams' => [
|
'constructParams' => [
|
||||||
$_SERVER
|
$serverVars
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
\Friendica\Module\Api\ApiResponse::class => [
|
\Friendica\Module\Api\ApiResponse::class => [
|
||||||
'constructParams' => [
|
'constructParams' => [
|
||||||
$_SERVER,
|
$serverVars,
|
||||||
$_GET['callback'] ?? '',
|
$_GET['callback'] ?? '',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
})();
|
})($_SERVER);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue