]> git.mxchange.org Git - friendica.git/blobdiff - bin/daemon.php
Display pending contacts in the contact list
[friendica.git] / bin / daemon.php
index 047bf71be77b4ac31dbea889098e5dd52dce8b5b..8ea60fa9ac79b86f247f30325e222de011c8df5c 100755 (executable)
@@ -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,7 +147,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);