X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=bin%2Fdaemon.php;h=f0154e74e8dcef2242d05bd16b3619fd30f987fb;hb=cdbc94a9e1b27f8843e3c423b46701338bebbf7a;hp=047bf71be77b4ac31dbea889098e5dd52dce8b5b;hpb=34748e8ffd6f2138556ea0df93d02231a8cdf4fa;p=friendica.git diff --git a/bin/daemon.php b/bin/daemon.php index 047bf71be7..f0154e74e8 100755 --- a/bin/daemon.php +++ b/bin/daemon.php @@ -7,11 +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\Factory; +use Friendica\DI; +use Psr\Log\LoggerInterface; // Get options $shortopts = 'f'; @@ -32,9 +34,13 @@ if (!file_exists("boot.php") && (sizeof($_SERVER["argv"]) != 0)) { require dirname(__DIR__) . '/vendor/autoload.php'; -$a = Factory\DependencyFactory::setUp('daemon', dirname(__DIR__)); +$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php'); +$dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['daemon']]); -if ($a->getMode()->isInstall()) { +DI::init($dice); +$a = DI::app(); + +if (DI::mode()->isInstall()) { die("Friendica isn't properly installed yet.\n"); } @@ -144,7 +150,7 @@ if (!$foreground) { file_put_contents($pidfile, $pid); // We lose the database connection upon forking - Factory\DBFactory::init($a->getConfigCache(), $a->getProfiler(), $_SERVER); + DBA::reconnect(); } Config::set('system', 'worker_daemon_mode', true);