Constants

API_ID

API_ID = '1'

Properties

$stockUaHeaders

$stockUaHeaders : 

Type

$config

$config : 

Type

$tree

$tree : 

Type

$properties

$properties : 

Type

$lookupValue

$lookupValue : 

Type

$MIN_JSON_VERSION

$MIN_JSON_VERSION : 

Type

$XMSG_JSON_LOAD

$XMSG_JSON_LOAD : 

Type

$XMSG_JSON_VERSION

$XMSG_JSON_VERSION : 

Type

$XMSG_JSON_INVALID

$XMSG_JSON_INVALID : 

Type

$XMSG_JSON_MISSING_REGEX_RULES

$XMSG_JSON_MISSING_REGEX_RULES : 

Type

$XMSG_CLIENT_PROPERTIES_NOT_SUPPORTED

$XMSG_CLIENT_PROPERTIES_NOT_SUPPORTED : 

Type

$XMSG_FILE_NOT_FOUND

$XMSG_FILE_NOT_FOUND : 

Type

$treeRegexes

$treeRegexes : 

Type

$uaProps

$uaProps : 

Type

$clientProps

$clientProps : 

Type

$deviceIdPropNameId

$deviceIdPropNameId : 

Type

Methods

__construct()

__construct(  $config) 

Create the JSON tree handler.

Parameters

$config
Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

setConfig()

setConfig(\type  $config) 

Set new config settings via a new Config object.

Parameters

\type $config
Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

loadTreeFromFile()

loadTreeFromFile(  $jsonDataFilePath) 

Load the JSON tree file into the handler.

Parameters

$jsonDataFilePath

Throws

\Mobi_Mtld_DA_Exception_DataFileException
\Mobi_Mtld_DA_Exception_JsonException

loadTreeFromString()

loadTreeFromString(  $json) 

Load the JSON tree into the handler.

Parameters

$json

Throws

\Mobi_Mtld_DA_Exception_JsonException

getPropertyNames()

getPropertyNames() 

Get the list of all available property names from the tree (not contains client side props)

Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

getDataVersion()

getDataVersion() 

Get data file version

Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

getDataCreationTimestamp()

getDataCreationTimestamp() 

Get data file creation timestamp

Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

getDataRevision()

getDataRevision() 

Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

putProperties()

putProperties(  $userAgent,   $stockUserAgents,   $clientside) 

Get properties from tree walk/ua/client-side and put them in the tree.properties

Parameters

$userAgent
$stockUserAgents
$clientside
Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

putTreeWalkProperties()

putTreeWalkProperties(  $userAgent,   $stockUserAgents = null) 

Get properties from tree walk/ua and put them in the tree.properties

if stockUserAgents != null

  • iterate over stockUserAgents for each item: tree-walk and stop iteration if result has deviceId
  • use userAgent for detecting the ua-props

    if stockUserAgents == null

  • use userAgent for tree walk
  • use userAgent for detecting the ua-props

Parameters

$userAgent
$stockUserAgents
Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

getLookupSource()

getLookupSource() : string

Get the source properties fetch source to be used for debugging.

Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

Returns

string —

'tree' or 'optimized tree' or 'cache'

sanitizeTree()

sanitizeTree() 

Throws

\Mobi_Mtld_DA_Exception_JsonException

seekProperties()

seekProperties(  $node,   $string,   $props2Vals,   $matched,   $regexRules) 

Seek properties for a user agent within a node. This is designed to be recursed, and only externally called with the node representing the top of the tree

Parameters

$node
$string
$props2Vals
$matched
$regexRules
Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275