X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=bin%2Fworker.php;h=52400a045a4e4b9d57051edbed9c6289ece7e412;hb=bc6d87afa88035e36e26254386adf2ec1d0c7cdb;hp=1b70a2095544a2d26b15160b230ddb9f733c4f21;hpb=097620b62799c96d610d73410ec07a6b8cdf82f0;p=friendica.git diff --git a/bin/worker.php b/bin/worker.php index 1b70a20955..52400a045a 100755 --- a/bin/worker.php +++ b/bin/worker.php @@ -21,8 +21,14 @@ * 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; @@ -53,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()); @@ -76,4 +84,4 @@ Worker::processQueue($run_cron); Worker::unclaimProcess(); -Worker::endProcess(); +DI::process()->end();