Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
zendframework1
library
Zend
Http
UserAgent
Features
Adapter
DeviceAtlas.php
Go to the documentation of this file.
1
<?php
25
#require_once 'Zend/Http/UserAgent/Features/Adapter.php';
26
37
class
Zend_Http_UserAgent_Features_Adapter_DeviceAtlas
implements
Zend_Http_UserAgent_Features_Adapter
38
{
45
public
static
function
getFromRequest
(
$request
, array
$config
)
46
{
47
if
(!
class_exists
(
'Mobi_Mtld_DA_Api'
)) {
48
if
(!isset(
$config
[
'deviceatlas'
])) {
49
#require_once 'Zend/Http/UserAgent/Features/Exception.php';
50
throw
new
Zend_Http_UserAgent_Features_Exception
(
'"DeviceAtlas" configuration is not defined'
);
51
}
52
}
53
54
$config
=
$config
[
'deviceatlas'
];
55
56
if
(!
class_exists
(
'Mobi_Mtld_DA_Api'
)) {
57
if
(empty(
$config
[
'deviceatlas_lib_dir'
])) {
58
#require_once 'Zend/Http/UserAgent/Features/Exception.php';
59
throw
new
Zend_Http_UserAgent_Features_Exception
(
'The "deviceatlas_lib_dir" parameter is not defined'
);
60
}
61
62
// Include the Device Atlas file from the specified lib_dir
63
#require_once ($config['deviceatlas_lib_dir'] . '/Mobi/Mtld/DA/Api.php');
64
}
65
66
if
(empty(
$config
[
'deviceatlas_data'
])) {
67
#require_once 'Zend/Http/UserAgent/Features/Exception.php';
68
throw
new
Zend_Http_UserAgent_Features_Exception
(
'The "deviceatlas_data" parameter is not defined'
);
69
}
70
71
//load the device data-tree : e.g. 'json/DeviceAtlas.json
72
$tree = Mobi_Mtld_DA_Api::getTreeFromFile(
$config
[
'deviceatlas_data'
]);
73
74
$properties
= Mobi_Mtld_DA_Api::getProperties($tree,
$request
[
'http_user_agent'
]);
75
76
return
$properties
;
77
}
78
}
$config
$config
Definition:
fraud_order.php:17
Zend_Http_UserAgent_Features_Adapter_DeviceAtlas\getFromRequest
static getFromRequest($request, array $config)
Definition:
DeviceAtlas.php:45
Zend_Http_UserAgent_Features_Adapter_DeviceAtlas
Definition:
DeviceAtlas.php:37
Zend_Http_UserAgent_Features_Exception
Definition:
Exception.php:34
$request
$request
Definition:
quote_with_configurable_product_last_variation.php:22
Magento\Framework\Code\Generator\class_exists
class_exists($className)
Definition:
DefinedClassesTest.php:15
$properties
$properties
Definition:
categories.php:26
Zend_Http_UserAgent_Features_Adapter
Definition:
Adapter.php:31