X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FApp%2FMode.php;h=3e7b9f0d1679a0fa07a362c8393c785d0d1452e9;hb=1138abe9237b9db1cf8a0ac7925de9bb55923cdb;hp=e19de8f07f4feaba6555f4f6b9394ee37ef9b7f8;hpb=90b42c16927906c496ac46142d4c7212a8da13bb;p=friendica.git diff --git a/src/App/Mode.php b/src/App/Mode.php index e19de8f07f..3e7b9f0d16 100644 --- a/src/App/Mode.php +++ b/src/App/Mode.php @@ -1,6 +1,6 @@ isBackend(); + $isBackend = $isBackend || in_array($args->getModuleName(), static::BACKEND_MODULES); $isMobile = $mobileDetect->isMobile(); $isTablet = $mobileDetect->isTablet(); $isAjax = strtolower($server['HTTP_X_REQUESTED_WITH'] ?? '') == 'xmlhttprequest'; @@ -163,6 +206,31 @@ class Mode return ($this->mode & $mode) > 0; } + /** + * Set the execution mode + * + * @param integer $executor Execution Mode + * @return void + */ + public function setExecutor(int $executor) + { + $this->executor = $executor; + + // Daemon and worker are always backend + if (in_array($executor, [self::DAEMON, self::WORKER])) { + $this->isBackend = true; + } + } + + /*isBackend = true;* + * get the execution mode + * + * @return int Execution Mode + */ + public function getExecutor() + { + return $this->executor; + } /** * Install mode is when the local config file is missing or the DB schema hasn't been installed yet.