Revert "Introduce Arguments / Module class"

This commit is contained in:
Hypolite Petovan 2019-08-11 18:01:11 -04:00 committed by GitHub
parent e9fc2af1c3
commit fcb1a78352
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 358 additions and 1083 deletions

View file

@ -27,14 +27,14 @@ use Psr\Log\LoggerInterface;
*
*/
return [
'*' => [
'*' => [
// marks all class result as shared for other creations, so there's just
// one instance for the whole execution
'shared' => true,
],
'$basepath' => [
'instanceOf' => Util\BasePath::class,
'call' => [
'$basepath' => [
'instanceOf' => Util\BasePath::class,
'call' => [
['getPath', [], Dice::CHAIN_CALL],
],
'constructParams' => [
@ -42,14 +42,14 @@ return [
$_SERVER
]
],
Util\BasePath::class => [
Util\BasePath::class => [
'constructParams' => [
dirname(__FILE__, 2),
$_SERVER
]
],
Util\ConfigFileLoader::class => [
'shared' => true,
Util\ConfigFileLoader::class => [
'shared' => true,
'constructParams' => [
[Dice::INSTANCE => '$basepath'],
],
@ -60,24 +60,24 @@ return [
['createCache', [], Dice::CHAIN_CALL],
],
],
App\Mode::class => [
'call' => [
App\Mode::class => [
'call' => [
['determine', [], Dice::CHAIN_CALL],
],
],
Config\Configuration::class => [
Config\Configuration::class => [
'instanceOf' => Factory\ConfigFactory::class,
'call' => [
'call' => [
['createConfig', [], Dice::CHAIN_CALL],
],
],
Config\PConfiguration::class => [
Config\PConfiguration::class => [
'instanceOf' => Factory\ConfigFactory::class,
'call' => [
'call' => [
['createPConfig', [], Dice::CHAIN_CALL],
]
],
Database::class => [
Database::class => [
'constructParams' => [
[DICE::INSTANCE => \Psr\Log\NullLogger::class],
$_SERVER,
@ -89,7 +89,7 @@ return [
* Same as:
* $baseURL = new Util\BaseURL($configuration, $_SERVER);
*/
Util\BaseURL::class => [
Util\BaseURL::class => [
'constructParams' => [
$_SERVER,
],
@ -106,46 +106,34 @@ return [
* $app = $dice->create(App::class, [], ['$channel' => 'index']);
* and is automatically passed as an argument with the same name
*/
LoggerInterface::class => [
LoggerInterface::class => [
'instanceOf' => Factory\LoggerFactory::class,
'call' => [
['create', [], Dice::CHAIN_CALL],
],
],
'$devLogger' => [
'$devLogger' => [
'instanceOf' => Factory\LoggerFactory::class,
'call' => [
['createDev', [], Dice::CHAIN_CALL],
]
],
Cache\ICache::class => [
Cache\ICache::class => [
'instanceOf' => Factory\CacheFactory::class,
'call' => [
['create', [], Dice::CHAIN_CALL],
],
],
Cache\IMemoryCache::class => [
Cache\IMemoryCache::class => [
'instanceOf' => Factory\CacheFactory::class,
'call' => [
['create', [], Dice::CHAIN_CALL],
],
],
ILock::class => [
ILock::class => [
'instanceOf' => Factory\LockFactory::class,
'call' => [
['create', [], Dice::CHAIN_CALL],
],
],
App\Arguments::class => [
'instanceOf' => App\Arguments::class,
'call' => [
['determine', [$_SERVER, $_GET], Dice::CHAIN_CALL],
],
],
App\Module::class => [
'instanceOf' => App\Module::class,
'call' => [
['determineModule', [$_SERVER], Dice::CHAIN_CALL],
],
],
];