]> git.mxchange.org Git - friendica.git/blobdiff - static/dependencies.config.php
Merge pull request #8072 from nupplaphil/task/Cache_to_DI
[friendica.git] / static / dependencies.config.php
index fc2da9c093fdb6c65d2092ebb8273f4519165e0f..ec80123aa346b9673d874a88cc2587266eb37c8f 100644 (file)
@@ -4,9 +4,15 @@ use Dice\Dice;
 use Friendica\App;
 use Friendica\Core\Cache;
 use Friendica\Core\Config;
+use Friendica\Core\L10n\L10n;
 use Friendica\Core\Lock\ILock;
+use Friendica\Core\Process;
+use Friendica\Core\Session\ISession;
+use Friendica\Core\StorageManager;
 use Friendica\Database\Database;
 use Friendica\Factory;
+use Friendica\Model\Storage\IStorage;
+use Friendica\Model\User\Cookie;
 use Friendica\Util;
 use Psr\Log\LoggerInterface;
 
@@ -62,17 +68,17 @@ return [
        ],
        App\Mode::class                 => [
                'call' => [
-                       ['determineRunMode', [$_SERVER], Dice::CHAIN_CALL],
+                       ['determineRunMode', [true, $_SERVER], Dice::CHAIN_CALL],
                        ['determine', [], Dice::CHAIN_CALL],
                ],
        ],
-       Config\Configuration::class     => [
+       Config\IConfiguration::class     => [
                'instanceOf' => Factory\ConfigFactory::class,
                'call'       => [
                        ['createConfig', [], Dice::CHAIN_CALL],
                ],
        ],
-       Config\PConfiguration::class    => [
+       Config\IPConfiguration::class    => [
                'instanceOf' => Factory\ConfigFactory::class,
                'call'       => [
                        ['createPConfig', [], Dice::CHAIN_CALL],
@@ -80,7 +86,7 @@ return [
        ],
        Database::class                 => [
                'constructParams' => [
-                       [DICE::INSTANCE => \Psr\Log\NullLogger::class],
+                       [Dice::INSTANCE => \Psr\Log\NullLogger::class],
                        $_SERVER,
                ],
        ],
@@ -114,12 +120,18 @@ return [
         */
        LoggerInterface::class          => [
                'instanceOf' => Factory\LoggerFactory::class,
+               'constructParams' => [
+                       'index',
+               ],
                'call'       => [
-                       ['create', [], Dice::CHAIN_CALL],
+                       ['create', ['index'], Dice::CHAIN_CALL],
                ],
        ],
        '$devLogger'                    => [
                'instanceOf' => Factory\LoggerFactory::class,
+               'constructParams' => [
+                       'dev',
+               ],
                'call'       => [
                        ['createDev', [], Dice::CHAIN_CALL],
                ]
@@ -154,9 +166,40 @@ return [
                        ['determineModule', [], Dice::CHAIN_CALL],
                ],
        ],
-       Friendica\Core\Process::class => [
+       Process::class => [
                'constructParams' => [
                        [Dice::INSTANCE => '$basepath'],
                ],
        ],
+       App\Router::class => [
+               'constructParams' => [
+                       $_SERVER, null
+               ],
+               'call' => [
+                       ['loadRoutes', [include __DIR__ . '/routes.config.php'], Dice::CHAIN_CALL],
+               ],
+       ],
+       L10n::class => [
+               'constructParams' => [
+                       $_SERVER, $_GET
+               ],
+       ],
+       ISession::class => [
+               'instanceOf' => Factory\SessionFactory::class,
+               'call' => [
+                       ['createSession', [$_SERVER], Dice::CHAIN_CALL],
+                       ['start', [], Dice::CHAIN_CALL],
+               ],
+       ],
+       Cookie::class => [
+               'constructParams' => [
+                       $_SERVER, $_COOKIE
+               ],
+       ],
+       IStorage::class => [
+               'instanceOf' => StorageManager::class,
+               'call' => [
+                       ['getBackend', [], Dice::CHAIN_CALL],
+               ],
+       ],
 ];