MobileFrontend
Mobile optimised frontend for MediaWiki
Loading...
Searching...
No Matches
MobileFrontend\Devices\CustomHeaderDeviceDetector Class Reference

Detects mobile devices by testing whether a custom request header is present. More...

+ Inheritance diagram for MobileFrontend\Devices\CustomHeaderDeviceDetector:
+ Collaboration diagram for MobileFrontend\Devices\CustomHeaderDeviceDetector:

Public Member Functions

 __construct (Config $config)
 
 detectDeviceProperties (WebRequest $request, array $server)
 @inheritDoc
 

Detailed Description

Detects mobile devices by testing whether a custom request header is present.

Note
See README.md for more detail on $wgMFMobileHeader.

Constructor & Destructor Documentation

◆ __construct()

MobileFrontend\Devices\CustomHeaderDeviceDetector::__construct ( Config $config)
Parameters
Config$configThe global config. Currently this can be any instance of GlobalVarConfig.
Todo
In future, however, this should probably be a MobileFrontend-specific instance. GlobalVarConfig#__construct accepts a custom prefix to avoid repeating prefixes in #get calls, e.g.
$config = new GlobalVarConfig();
$mobileFrontendConfig = new GlobalVarConfig( 'wgMF' );
assert(
$config->get( 'MFMobileHeader' )
=== $mobileFrontendConfig->get( 'MobileHeader' )
);

Member Function Documentation

◆ detectDeviceProperties()

MobileFrontend\Devices\CustomHeaderDeviceDetector::detectDeviceProperties ( WebRequest $request,
array $server )

@inheritDoc

Implements MobileFrontend\Devices\DeviceDetector.


The documentation for this class was generated from the following file: