X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=bin%2Fworker.php;h=469dcb001e6419accd062df13597abc705cfbf2d;hb=d0068170db2624f14aed6b5d801c948cdf5cbc90;hp=a64b6a83305660f705bf5530141061ddcf379269;hpb=8f9c0fe14956efbcaf0db9dbfb83222e18e0ab2f;p=friendica.git diff --git a/bin/worker.php b/bin/worker.php index a64b6a8330..469dcb001e 100755 --- a/bin/worker.php +++ b/bin/worker.php @@ -4,11 +4,14 @@ * @file bin/worker.php * @brief Starts the background processing */ + +use Dice\Dice; use Friendica\App; +use Friendica\BaseObject; use Friendica\Core\Config; -use Friendica\Core\Worker; use Friendica\Core\Update; -use Friendica\Util\LoggerFactory; +use Friendica\Core\Worker; +use Psr\Log\LoggerInterface; // Get options $shortopts = 'sn'; @@ -29,12 +32,14 @@ if (!file_exists("boot.php") && (sizeof($_SERVER["argv"]) != 0)) { require dirname(__DIR__) . '/vendor/autoload.php'; -$logger = LoggerFactory::create('worker'); +$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php'); +$dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['worker']]); -$a = new App(dirname(__DIR__), $logger); +BaseObject::setDependencyInjection($dice); +$a = BaseObject::getApp(); // Check the database structure and possibly fixes it -Update::check(true); +Update::check($a->getBasePath(), true, $a->getMode()); // Quit when in maintenance if (!$a->getMode()->has(App\Mode::MAINTENANCEDISABLED)) {