Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1425727
AMFDeviceDetector.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
846 B
Referenced Files
None
Subscribers
None
AMFDeviceDetector.php
View Options
<?php
namespace
MobileFrontend\Devices
;
use
MediaWiki\Request\WebRequest
;
/**
* Detect mobile and tablet devices using environment variables set by the
* Apache Mobile Filter (AMF) module.
*
* @link http://wiki.apachemobilefilter.org/index.php/Main_Page
*/
class
AMFDeviceDetector
implements
DeviceDetector
{
/**
* @inheritDoc
*/
public
function
detectDeviceProperties
(
WebRequest
$request
,
array
$server
)
{
$hasIsMobile
=
isset
(
$server
[
'AMF_DEVICE_IS_MOBILE'
]
);
$hasIsTablet
=
isset
(
$server
[
'AMF_DEVICE_IS_TABLET'
]
);
if
(
!
$hasIsMobile
&&
!
$hasIsTablet
)
{
return
null
;
}
$isMobileDevice
=
$hasIsMobile
&&
$server
[
'AMF_DEVICE_IS_MOBILE'
]
===
'true'
;
$isTabletDevice
=
$hasIsTablet
&&
$server
[
'AMF_DEVICE_IS_TABLET'
]
===
'true'
;
return
new
DeviceProperties
(
$isMobileDevice
,
$isTabletDevice
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 16, 11:53 (15 h, 45 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
9a/17/f59ec99556bde0db39a89db110a9
Default Alt Text
AMFDeviceDetector.php (846 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment