X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FApp%2FMode.php;h=59a47d8284360bf8838c826ebf52dc45f9105c14;hb=319857edaa1257c885ce7f3a91ee168b95feee10;hp=4a1213ae12933cdf48e29d1d96a7e82af245f8ee;hpb=3bae52074a644b0ade3808bed9fc1268e1baa4e3;p=friendica.git diff --git a/src/App/Mode.php b/src/App/Mode.php index 4a1213ae12..59a47d8284 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'; @@ -169,7 +200,7 @@ class Mode * * @return bool returns true, if the mode is set */ - public function has($mode) + public function has(int $mode): bool { return ($this->mode & $mode) > 0; } @@ -195,7 +226,7 @@ class Mode * * @return int Execution Mode */ - public function getExecutor() + public function getExecutor(): int { return $this->executor; } @@ -203,9 +234,9 @@ class Mode /** * Install mode is when the local config file is missing or the DB schema hasn't been installed yet. * - * @return bool + * @return bool Whether installation mode is active (local/database configuration files present or not) */ - public function isInstall() + public function isInstall(): bool { return !$this->has(Mode::LOCALCONFIGPRESENT) || !$this->has(MODE::DBCONFIGAVAILABLE); @@ -216,7 +247,7 @@ class Mode * * @return bool */ - public function isNormal() + public function isNormal(): bool { return $this->has(Mode::LOCALCONFIGPRESENT) && $this->has(Mode::DBAVAILABLE) && @@ -229,7 +260,7 @@ class Mode * * @return bool Is it a backend call */ - public function isBackend() + public function isBackend(): bool { return $this->isBackend; } @@ -239,7 +270,7 @@ class Mode * * @return bool true if it was an AJAX request */ - public function isAjax() + public function isAjax(): bool { return $this->isAjax; } @@ -249,7 +280,7 @@ class Mode * * @return bool true if it was an mobile request */ - public function isMobile() + public function isMobile(): bool { return $this->isMobile; } @@ -259,7 +290,7 @@ class Mode * * @return bool true if it was an tablet request */ - public function isTablet() + public function isTablet(): bool { return $this->isTablet; }