]> git.mxchange.org Git - friendica.git/blobdiff - bin/daemon.php
Coding standards
[friendica.git] / bin / daemon.php
index 965c495ecdbc5af9cf0961cb15319ea93c28fa85..490a92ab84bb160449268e64cfff792ae2b61a84 100755 (executable)
  * 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;
@@ -197,7 +196,7 @@ while (true) {
                $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]);