X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=static%2Fdependencies.config.php;h=84344a60e28a660493540420514b6f9b60437cda;hb=37d61fbc44808637a7f323ceb5e902696cbd3b7b;hp=b4fa7d247a28a5e81a3033fb29c4f24eaa0b95fe;hpb=1bc4b2e0788ac11d3b377013b410f2250fff68aa;p=friendica.git diff --git a/static/dependencies.config.php b/static/dependencies.config.php index b4fa7d247a..84344a60e2 100644 --- a/static/dependencies.config.php +++ b/static/dependencies.config.php @@ -1,4 +1,37 @@ . + * + * The configuration defines "complex" dependencies inside Friendica + * So this classes shouldn't be simple or their dependencies are already defined here. + * + * This kind of dependencies are NOT required to be defined here: + * - $a = new ClassA(new ClassB()); + * - $a = new ClassA(); + * - $a = new ClassA(Configuration $configuration); + * + * This kind of dependencies SHOULD be defined here: + * - $a = new ClassA(); + * $b = $a->create(); + * + * - $a = new ClassA($creationPassedVariable); + * + */ use Dice\Dice; use Friendica\App; @@ -16,22 +49,6 @@ use Friendica\Model\User\Cookie; use Friendica\Util; use Psr\Log\LoggerInterface; -/** - * The configuration defines "complex" dependencies inside Friendica - * So this classes shouldn't be simple or their dependencies are already defined here. - * - * This kind of dependencies are NOT required to be defined here: - * - $a = new ClassA(new ClassB()); - * - $a = new ClassA(); - * - $a = new ClassA(Configuration $configuration); - * - * This kind of dependencies SHOULD be defined here: - * - $a = new ClassA(); - * $b = $a->create(); - * - * - $a = new ClassA($creationPassedVariable); - * - */ return [ '*' => [ // marks all class result as shared for other creations, so there's just @@ -48,43 +65,43 @@ return [ $_SERVER ] ], - Util\BasePath::class => [ + Util\BasePath::class => [ 'constructParams' => [ dirname(__FILE__, 2), $_SERVER ] ], - Util\ConfigFileLoader::class => [ + Util\ConfigFileLoader::class => [ 'shared' => true, 'constructParams' => [ [Dice::INSTANCE => '$basepath'], ], ], - Config\Cache\ConfigCache::class => [ + Config\Cache::class => [ 'instanceOf' => Factory\ConfigFactory::class, 'call' => [ ['createCache', [], Dice::CHAIN_CALL], ], ], - App\Mode::class => [ + App\Mode::class => [ 'call' => [ ['determineRunMode', [true, $_SERVER], Dice::CHAIN_CALL], ['determine', [], Dice::CHAIN_CALL], ], ], - Config\IConfiguration::class => [ + Config\IConfig::class => [ 'instanceOf' => Factory\ConfigFactory::class, 'call' => [ ['createConfig', [], Dice::CHAIN_CALL], ], ], - Config\IPConfiguration::class => [ + \Friendica\Core\PConfig\IPConfig::class => [ 'instanceOf' => Factory\ConfigFactory::class, 'call' => [ ['createPConfig', [], Dice::CHAIN_CALL], ] ], - Database::class => [ + Database::class => [ 'constructParams' => [ [Dice::INSTANCE => \Psr\Log\NullLogger::class], $_SERVER,