Using method-chaining for DICE
This commit is contained in:
parent
a66580444f
commit
9682cc440c
9 changed files with 27 additions and 25 deletions
|
@ -32,6 +32,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
use Dice\Dice;
|
||||
use Friendica\App\Mode;
|
||||
use Friendica\BaseObject;
|
||||
use Friendica\Util\ExAuth;
|
||||
|
@ -52,8 +53,7 @@ chdir($directory);
|
|||
|
||||
require dirname(__DIR__) . '/vendor/autoload.php';
|
||||
|
||||
$dice = new \Dice\Dice();
|
||||
$dice = $dice->addRules(include __DIR__ . '/../static/dependencies.config.php');
|
||||
$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php');
|
||||
BaseObject::setDependencyInjection($dice);
|
||||
|
||||
$appMode = $dice->create(Mode::class);
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
use Dice\Dice;
|
||||
|
||||
require dirname(__DIR__) . '/vendor/autoload.php';
|
||||
|
||||
$dice = new \Dice\Dice();
|
||||
$dice = $dice->addRules(include __DIR__ . '/../static/dependencies.config.php');
|
||||
$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php');
|
||||
|
||||
(new Friendica\Core\Console($dice, $argv))->execute();
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
* This script was taken from http://php.net/manual/en/function.pcntl-fork.php
|
||||
*/
|
||||
|
||||
use Dice\Dice;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Worker;
|
||||
|
@ -31,8 +32,7 @@ if (!file_exists("boot.php") && (sizeof($_SERVER["argv"]) != 0)) {
|
|||
|
||||
require dirname(__DIR__) . '/vendor/autoload.php';
|
||||
|
||||
$dice = new \Dice\Dice();
|
||||
$dice = $dice->addRules(include __DIR__ . '/../static/dependencies.config.php');
|
||||
$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php');
|
||||
|
||||
\Friendica\BaseObject::setDependencyInjection($dice);
|
||||
$a = \Friendica\BaseObject::getApp();
|
||||
|
|
|
@ -5,7 +5,9 @@
|
|||
* @brief Starts the background processing
|
||||
*/
|
||||
|
||||
use Dice\Dice;
|
||||
use Friendica\App;
|
||||
use Friendica\BaseObject;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\Update;
|
||||
use Friendica\Core\Worker;
|
||||
|
@ -29,11 +31,10 @@ if (!file_exists("boot.php") && (sizeof($_SERVER["argv"]) != 0)) {
|
|||
|
||||
require dirname(__DIR__) . '/vendor/autoload.php';
|
||||
|
||||
$dice = new \Dice\Dice();
|
||||
$dice = $dice->addRules(include __DIR__ . '/../static/dependencies.config.php');
|
||||
$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php');
|
||||
|
||||
\Friendica\BaseObject::setDependencyInjection($dice);
|
||||
$a = \Friendica\BaseObject::getApp();
|
||||
BaseObject::setDependencyInjection($dice);
|
||||
$a = BaseObject::getApp();
|
||||
|
||||
// Check the database structure and possibly fixes it
|
||||
Update::check($a->getBasePath(), true, $a->getMode());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue