X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=bin%2Fworker.php;h=2b5915f471d4fc76b9fdfdee1bad2ff42318cea0;hb=d2e43619b330ca21f8eff51307c91a83add92e9b;hp=9ae2f68b3e6ae8a0fbe994b6fe47bf834aee2bb2;hpb=bd972151478f40f73585519110700222a1931d44;p=friendica.git diff --git a/bin/worker.php b/bin/worker.php index 9ae2f68b3e..2b5915f471 100755 --- a/bin/worker.php +++ b/bin/worker.php @@ -4,10 +4,12 @@ * @file bin/worker.php * @brief Starts the background processing */ + use Friendica\App; use Friendica\Core\Config; -use Friendica\Core\Worker; use Friendica\Core\Update; +use Friendica\Core\Worker; +use Friendica\Factory; // Get options $shortopts = 'sn'; @@ -26,12 +28,12 @@ if (!file_exists("boot.php") && (sizeof($_SERVER["argv"]) != 0)) { chdir($directory); } -require_once "boot.php"; +require dirname(__DIR__) . '/vendor/autoload.php'; -$a = new App(dirname(__DIR__)); +$a = Factory\DependencyFactory::setUp('worker', dirname(__DIR__)); // 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)) { @@ -44,7 +46,7 @@ $spawn = array_key_exists('s', $options) || array_key_exists('spawn', $options); if ($spawn) { Worker::spawnWorker(); - killme(); + exit(); } $run_cron = !array_key_exists('n', $options) && !array_key_exists('no_cron', $options);