X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=static%2Fdependencies.config.php;h=3dfde6b5f47c0e1c65ec8b2e5db931cf8cc5db1e;hb=156e3fa10104b66265cf6b19064725d12de4729e;hp=5aba529db2270cd2a6611522bb4f0d2bb38252b6;hpb=8db0e090d7afc3fbfeaf7a587140c80c98233484;p=friendica.git diff --git a/static/dependencies.config.php b/static/dependencies.config.php index 5aba529db2..3dfde6b5f4 100644 --- a/static/dependencies.config.php +++ b/static/dependencies.config.php @@ -1,6 +1,6 @@ true, ], + \Friendica\Core\Addon\Capability\ICanLoadAddons::class => [ + 'instanceOf' => \Friendica\Core\Addon\Model\AddonLoader::class, + 'constructParams' => [ + [Dice::INSTANCE => '$basepath'], + [Dice::INSTANCE => Dice::SELF], + ], + ], '$basepath' => [ 'instanceOf' => Util\BasePath::class, 'call' => [ @@ -75,10 +86,35 @@ return [ $_SERVER ] ], - Config\Util\ConfigFileLoader::class => [ + DiceInstanceManager::class => [ + 'constructParams' => [ + [Dice::INSTANCE => Dice::SELF], + ] + ], + \Friendica\Core\Hooks\Util\StrategiesFileManager::class => [ + 'constructParams' => [ + [Dice::INSTANCE => '$basepath'], + ], + 'call' => [ + ['loadConfig'], + ], + ], + ICanRegisterStrategies::class => [ + 'instanceOf' => DiceInstanceManager::class, + 'constructParams' => [ + [Dice::INSTANCE => Dice::SELF], + ], + ], + ICanCreateInstances::class => [ + 'instanceOf' => DiceInstanceManager::class, + 'constructParams' => [ + [Dice::INSTANCE => Dice::SELF], + ], + ], + Config\Util\ConfigFileManager::class => [ 'instanceOf' => Config\Factory\Config::class, 'call' => [ - ['createConfigFileLoader', [ + ['createConfigFileManager', [ [Dice::INSTANCE => '$basepath'], $_SERVER, ], Dice::CHAIN_CALL], @@ -87,19 +123,21 @@ return [ Config\ValueObject\Cache::class => [ 'instanceOf' => Config\Factory\Config::class, 'call' => [ - ['createCache', [$_SERVER], Dice::CHAIN_CALL], + ['createCache', [], Dice::CHAIN_CALL], ], ], App\Mode::class => [ 'call' => [ ['determineRunMode', [true, $_SERVER], Dice::CHAIN_CALL], - ['determine', [], Dice::CHAIN_CALL], + ['determine', [ + [Dice::INSTANCE => '$basepath'] + ], Dice::CHAIN_CALL], ], ], Config\Capability\IManageConfigValues::class => [ - 'instanceOf' => Config\Factory\Config::class, - 'call' => [ - ['create', [], Dice::CHAIN_CALL], + 'instanceOf' => Config\Model\DatabaseConfig::class, + 'constructParams' => [ + $_SERVER, ], ], PConfig\Capability\IManagePersonalConfigValues::class => [ @@ -126,7 +164,7 @@ return [ ], Database::class => [ 'constructParams' => [ - [Dice::INSTANCE => \Psr\Log\NullLogger::class], + [Dice::INSTANCE => Config\Model\ReadOnlyFileConfig::class], ], ], /** @@ -140,40 +178,54 @@ return [ $_SERVER, ], ], + '$hostname' => [ + 'instanceOf' => App\BaseURL::class, + 'constructParams' => [ + $_SERVER, + ], + 'call' => [ + ['getHost', [], Dice::CHAIN_CALL], + ], + ], + Cache\Type\AbstractCache::class => [ + 'constructParams' => [ + [Dice::INSTANCE => '$hostname'], + ], + ], App\Page::class => [ 'constructParams' => [ [Dice::INSTANCE => '$basepath'], ], ], - /** - * Create a Logger, which implements the LoggerInterface - * - * Same as: - * $loggerFactory = new Factory\LoggerFactory(); - * $logger = $loggerFactory->create($channel, $configuration, $profiler); - * - * Attention1: We can use DICE for detecting dependencies inside "chained" calls too - * Attention2: The variable "$channel" is passed inside the creation of the dependencies per: - * $app = $dice->create(App::class, [], ['$channel' => 'index']); - * and is automatically passed as an argument with the same name - */ - LoggerInterface::class => [ + \Psr\Log\LoggerInterface::class => [ 'instanceOf' => \Friendica\Core\Logger\Factory\Logger::class, - 'constructParams' => [ - 'index', + 'call' => [ + ['create', [], Dice::CHAIN_CALL], ], + ], + \Friendica\Core\Logger\Type\SyslogLogger::class => [ + 'instanceOf' => \Friendica\Core\Logger\Factory\SyslogLogger::class, 'call' => [ ['create', [], Dice::CHAIN_CALL], ], ], - '$devLogger' => [ - 'instanceOf' => \Friendica\Core\Logger\Factory\Logger::class, + \Friendica\Core\Logger\Type\StreamLogger::class => [ + 'instanceOf' => \Friendica\Core\Logger\Factory\StreamLogger::class, + 'call' => [ + ['create', [], Dice::CHAIN_CALL], + ], + ], + \Friendica\Core\Logger\Capability\IHaveCallIntrospections::class => [ + 'instanceOf' => \Friendica\Core\Logger\Util\Introspection::class, 'constructParams' => [ - 'dev', + \Friendica\Core\Logger\Capability\IHaveCallIntrospections::IGNORE_CLASS_LIST, ], + ], + '$devLogger' => [ + 'instanceOf' => \Friendica\Core\Logger\Factory\StreamLogger::class, 'call' => [ ['createDev', [], Dice::CHAIN_CALL], - ] + ], ], Cache\Capability\ICanCache::class => [ 'instanceOf' => Cache\Factory\Cache::class, @@ -220,10 +272,13 @@ return [ IHandleSessions::class => [ 'instanceOf' => \Friendica\Core\Session\Factory\Session::class, 'call' => [ - ['createSession', [$_SERVER], Dice::CHAIN_CALL], + ['create', [$_SERVER], Dice::CHAIN_CALL], ['start', [], Dice::CHAIN_CALL], ], ], + IHandleUserSessions::class => [ + 'instanceOf' => \Friendica\Core\Session\Model\UserSession::class, + ], Cookie::class => [ 'constructParams' => [ $_COOKIE @@ -235,6 +290,12 @@ return [ ['getBackend', [], Dice::CHAIN_CALL], ], ], + \Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs::class => [ + 'instanceOf' => \Friendica\Core\KeyValueStorage\Factory\KeyValueStorage::class, + 'call' => [ + ['create', [], Dice::CHAIN_CALL], + ], + ], Network\HTTPClient\Capability\ICanSendHttpRequests::class => [ 'instanceOf' => Network\HTTPClient\Factory\HttpClient::class, 'call' => [ @@ -260,5 +321,13 @@ return [ 'constructParams' => [ $_SERVER ], - ] + ], + \Psr\Clock\ClockInterface::class => [ + 'instanceOf' => Util\Clock\SystemClock::class + ], + \Friendica\Module\Special\HTTPException::class => [ + 'constructParams' => [ + $_SERVER + ], + ], ];