#!/usr/bin/env php
<?php
/**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This script was taken from http://php.net/manual/en/function.pcntl-fork.php
*/
-use Friendica\Network\HTTPException\ForbiddenException;
-
if (php_sapi_name() !== 'cli') {
- throw new ForbiddenException();
+ header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden');
+ exit();
}
use Dice\Dice;
$do_cron = true;
}
- if ($do_cron || (!DI::process()->isMaxLoadReached() && Worker::entriesExists() && Worker::isReady())) {
+ if ($do_cron || (!DI::system()->isMaxLoadReached() && Worker::entriesExists() && Worker::isReady())) {
Worker::spawnWorker($do_cron);
} else {
Logger::info('Cool down for 5 seconds', ['pid' => $pid]);