X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=bin%2Fworker.php;h=52400a045a4e4b9d57051edbed9c6289ece7e412;hb=68502daed09a69804650a6501baefc3a3fdf61b7;hp=106c9b81f17ece58c7977f88b2803f7e57fcd393;hpb=04d620fc2f567d32b50f5d5b0974acafeb072177;p=friendica.git diff --git a/bin/worker.php b/bin/worker.php index 106c9b81f1..52400a045a 100755 --- a/bin/worker.php +++ b/bin/worker.php @@ -1,12 +1,34 @@ #!/usr/bin/env php . + * * Starts the background processing */ +if (php_sapi_name() !== 'cli') { + header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden'); + exit(); +} + use Dice\Dice; use Friendica\App; +use Friendica\App\Mode; use Friendica\Core\Update; use Friendica\Core\Worker; use Friendica\DI; @@ -37,6 +59,8 @@ $dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['worker']]) DI::init($dice); $a = DI::app(); +DI::mode()->setExecutor(Mode::WORKER); + // Check the database structure and possibly fixes it Update::check($a->getBasePath(), true, DI::mode()); @@ -60,4 +84,4 @@ Worker::processQueue($run_cron); Worker::unclaimProcess(); -Worker::endProcess(); +DI::process()->end();