Public Member Functions | |
__construct (&$tree) | |
getProperties ($userAgent, $idProperties, $sought, $typedValues) | |
Public Member Functions inherited from Mobi_Mtld_DA_PostWalkRules | |
__construct (array &$tree, $type) | |
propIsOutput ($propertyId) | |
getRequiredProperties () |
Public Attributes | |
const | UA_RULES = "uar" |
const | SKIP_IDS = "sk" |
const | REGEXES = "reg" |
const | DEFAULT_REGEX_SET = "d" |
const | REFINE_REGEX_ID = "f" |
const | SEARCH_REGEX_ID = "s" |
const | RULE_REGEX_ID = "r" |
const | REGEX_MATCH_POS = "m" |
Public Attributes inherited from Mobi_Mtld_DA_PostWalkRules | |
const | RULE_GROUPS = "rg" |
const | PROPERTY_MATCHER = "p" |
const | PROPERTY = "p" |
const | PROPERTY_VALUE = "v" |
const | OPERATOR = "o" |
const | RULE_ARR = "r" |
const | RULE_PROP_IDS_IN_USE = "rpids" |
const | MATCHER_PROP_IDS_IN_USE = "mpids" |
const | RULE_SET = "t" |
const | RULE_SET_COUNT = "tc" |
Protected Member Functions | |
_initGetMatcherPropertyIds ($group, $propIds) | |
_initRuleSets ($group) |
Additional Inherited Members | |
Protected Attributes inherited from Mobi_Mtld_DA_PostWalkRules | |
$tree | |
$branch | |
$propertyNameToId | |
$propertyIdToType |
This class is used by the main Api class and should not be used directly.
This class tries to extract properties from the User-Agent string itself. This is a completely separate step to the main JSON tree walk but uses the results of the tree walk to optimise the property extraction. The property extraction is done in two steps.
Step 1: Try and identify the type of User-Agent and thus the set of property extraction rules to run. This is optimised by the properties from the tree walk.
Step 2: Run the rules found in step 1 to try and extract the properties.
|
protected |
Find all the properties that are used for matching. This is needed in case the Api.getProperty() function is called as we need these properties for the User-Agent extraction rules to work correctly.
array | $group | The rule group that can contain a property matcher |
array | $propIds | The set of found property IDs to which new ones are added to |
Reimplemented from Mobi_Mtld_DA_PostWalkRules.
|
protected |
Prepare the rule set by extracting it from the current group and counting the items in the group. This is done to avoid counting the items on every request.
array | $group | The current parent group. |
Reimplemented from Mobi_Mtld_DA_PostWalkRules.
Mobi_Mtld_DA_UaProps::getProperties | ( | $userAgent, | |
$idProperties, | |||
$sought, | |||
$typedValues | |||
) |
Get the User-Agent string properties using the User-Agent rules
string | $userAgent | The User-Agent to find properties for |
array | $idProperties | The results of the tree walk, map of property id to value id |
array | $sought | A set of properties to return values for |
boolean | $typedValues | Whether to return typed values or string values |