const BACKEND_CONTENT_TYPES = ['application/jrd+json', 'text/xml',
'application/rss+xml', 'application/atom+xml', 'application/activity+json'];
const BACKEND_CONTENT_TYPES = ['application/jrd+json', 'text/xml',
'application/rss+xml', 'application/atom+xml', 'application/activity+json'];
* Checks if the site is called via a backend process
*
* @param bool $isBackend True, if the call is from a backend script (daemon, worker, ...)
* Checks if the site is called via a backend process
*
* @param bool $isBackend True, if the call is from a backend script (daemon, worker, ...)
* @param MobileDetect $mobileDetect The mobile detection library
*
* @return Mode returns the determined mode
*/
* @param MobileDetect $mobileDetect The mobile detection library
*
* @return Mode returns the determined mode
*/
- public function determineRunMode(bool $isBackend, ModuleController $module, array $server, MobileDetect $mobileDetect)
+ public function determineRunMode(bool $isBackend, array $server, Arguments $args, MobileDetect $mobileDetect): Mode
{
foreach (self::BACKEND_CONTENT_TYPES as $type) {
if (strpos(strtolower($server['HTTP_ACCEPT'] ?? ''), $type) !== false) {
{
foreach (self::BACKEND_CONTENT_TYPES as $type) {
if (strpos(strtolower($server['HTTP_ACCEPT'] ?? ''), $type) !== false) {
$isMobile = $mobileDetect->isMobile();
$isTablet = $mobileDetect->isTablet();
$isAjax = strtolower($server['HTTP_X_REQUESTED_WITH'] ?? '') == 'xmlhttprequest';
$isMobile = $mobileDetect->isMobile();
$isTablet = $mobileDetect->isTablet();
$isAjax = strtolower($server['HTTP_X_REQUESTED_WITH'] ?? '') == 'xmlhttprequest';