X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=bin%2Fdaemon.php;h=f0154e74e8dcef2242d05bd16b3619fd30f987fb;hb=cdbc94a9e1b27f8843e3c423b46701338bebbf7a;hp=ac6385cbb973fb2d7680cdc6cde4e45c326e5fbd;hpb=9d45118356b0a72172661ae373845e403b4ed9dc;p=friendica.git diff --git a/bin/daemon.php b/bin/daemon.php index ac6385cbb9..f0154e74e8 100755 --- a/bin/daemon.php +++ b/bin/daemon.php @@ -7,10 +7,13 @@ * 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; use Friendica\Database\DBA; +use Friendica\DI; +use Psr\Log\LoggerInterface; // Get options $shortopts = 'f'; @@ -31,13 +34,13 @@ 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'); +$dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['daemon']]); -\Friendica\BaseObject::setDependencyInjection($dice); -$a = \Friendica\BaseObject::getApp(); +DI::init($dice); +$a = DI::app(); -if ($a->getMode()->isInstall()) { +if (DI::mode()->isInstall()) { die("Friendica isn't properly installed yet.\n"); }