X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=bin%2Fdaemon.php;h=8ea60fa9ac79b86f247f30325e222de011c8df5c;hb=591ba9c68e82491468f7e97c966b2e5e3c0eefd6;hp=298cfa2534ad1221ddbf1cf7561de89830b354e2;hpb=8c3aebc376a496e5f6ac93cda8ba88b1bd1261fa;p=friendica.git diff --git a/bin/daemon.php b/bin/daemon.php index 298cfa2534..8ea60fa9ac 100755 --- a/bin/daemon.php +++ b/bin/daemon.php @@ -7,11 +7,11 @@ * 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; // Get options $shortopts = 'f'; @@ -32,7 +32,10 @@ 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'); + +\Friendica\BaseObject::setDependencyInjection($dice); +$a = \Friendica\BaseObject::getApp(); if ($a->getMode()->isInstall()) { die("Friendica isn't properly installed yet.\n"); @@ -144,9 +147,7 @@ if (!$foreground) { file_put_contents($pidfile, $pid); // We lose the database connection upon forking - /// @todo refactoring during https://github.com/friendica/friendica/issues/6720 - $basePath = \Friendica\Util\BasePath::create(dirname(__DIR__), $_SERVER); - Factory\DBFactory::init($basePath, $a->getConfigCache(), $a->getProfiler(), $_SERVER); + DBA::reconnect(); } Config::set('system', 'worker_daemon_mode', true);