Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4074697
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
Aug 17 2026, 16:30 (10 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
3d/b1/7b13373da01bef9e4a959fab60ba
Default Alt Text
AMFDeviceDetector.php (846 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment