Fix formating
This commit is contained in:
parent
92538c57f6
commit
f4fedc832e
2 changed files with 39 additions and 21 deletions
36
app/init.php
36
app/init.php
|
@ -886,7 +886,9 @@ App::setResource('localeCodes', function () {
|
|||
App::setResource('queue', function (Group $pools) {
|
||||
$connection = $pools->get('queue')->pop();
|
||||
|
||||
App::setResource('connectionForQueue', function () use ($connection) { return $connection; }, []);
|
||||
App::setResource('connectionForQueue', function () use ($connection) {
|
||||
return $connection;
|
||||
}, []);
|
||||
|
||||
return $connection->getResource();
|
||||
}, ['pools']);
|
||||
|
@ -1112,10 +1114,18 @@ App::setResource('console', function () {
|
|||
]);
|
||||
}, []);
|
||||
|
||||
App::setResource('connectionForProject', function () { return null; }, []);
|
||||
App::setResource('connectionForConsole', function () { return null; }, []);
|
||||
App::setResource('connectionForQueue', function () { return null; }, []);
|
||||
App::setResource('connectionsForCache', function () { return []; }, []);
|
||||
App::setResource('connectionForProject', function () {
|
||||
return null;
|
||||
}, []);
|
||||
App::setResource('connectionForConsole', function () {
|
||||
return null;
|
||||
}, []);
|
||||
App::setResource('connectionForQueue', function () {
|
||||
return null;
|
||||
}, []);
|
||||
App::setResource('connectionsForCache', function () {
|
||||
return [];
|
||||
}, []);
|
||||
|
||||
App::setResource('dbForProject', function (Group $pools, Database $dbForConsole, Cache $cache, Document $project) {
|
||||
if ($project->isEmpty() || $project->getId() === 'console') {
|
||||
|
@ -1127,7 +1137,9 @@ App::setResource('dbForProject', function (Group $pools, Database $dbForConsole,
|
|||
->pop()
|
||||
;
|
||||
|
||||
App::setResource('connectionForProject', function () use ($connection) { return $connection; }, []);
|
||||
App::setResource('connectionForProject', function () use ($connection) {
|
||||
return $connection;
|
||||
}, []);
|
||||
|
||||
$dbAdapter = $connection->getResource();
|
||||
|
||||
|
@ -1145,7 +1157,9 @@ App::setResource('dbForConsole', function (Group $pools, Cache $cache) {
|
|||
->get('console')
|
||||
->pop();
|
||||
|
||||
App::setResource('connectionForConsole', function () use ($connection) { return $connection; }, []);
|
||||
App::setResource('connectionForConsole', function () use ($connection) {
|
||||
return $connection;
|
||||
}, []);
|
||||
|
||||
$dbAdapter = $connection->getResource();
|
||||
|
||||
|
@ -1171,7 +1185,9 @@ App::setResource('getProjectDB', function (Group $pools, Database $dbForConsole,
|
|||
|
||||
$dbAdapter = $connection->getResource();
|
||||
|
||||
App::setResource('connectionForProject', function () use ($connection) { return $connection; }, []);
|
||||
App::setResource('connectionForProject', function () use ($connection) {
|
||||
return $connection;
|
||||
}, []);
|
||||
|
||||
$database = new Database($dbAdapter, $cache);
|
||||
|
||||
|
@ -1200,7 +1216,9 @@ App::setResource('cache', function (Group $pools) {
|
|||
$adapters[] = $connection->getResource();
|
||||
}
|
||||
|
||||
App::setResource('connectionsForCache', function () use ($connections) { return $connections; }, []);
|
||||
App::setResource('connectionsForCache', function () use ($connections) {
|
||||
return $connections;
|
||||
}, []);
|
||||
|
||||
return new Cache(new Sharding($adapters));
|
||||
}, ['pools']);
|
||||
|
|
Loading…
Reference in a new issue