Class Mobi_Mtld_DA_UaProps

Description

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.

  • author: dotMobi

Located in /UaProps.php (line 21)


	
			
Variable Summary
static mixed $UA_RULES
Method Summary
static Hashmap getProperties (tree &$tree, userAgent $userAgent, idProperties $idProperties, propertyId $typedValues, [typedValues $propertyId = null])
static The getProperty (tree &$tree, userAgent $userAgent, idProperties $idProperties, propertyId $propertyId, typedValues $typedValues)
static The getRequiredProperties (tree &$tree)
static void init (tree &$tree)
static TRUE isUaProp (tree &$tree, propertyId $propertyId)
Variables
static mixed $UA_RULES = "uar" (line 23)
  • access: public
Methods
static method getProperties (line 232)

Get the User-Agent string properties using the User-Agent rules

  • return: of properties or NULL if there are no properties
  • access: public
static Hashmap getProperties (tree &$tree, userAgent $userAgent, idProperties $idProperties, propertyId $typedValues, [typedValues $propertyId = null])
  • tree &$tree: The main JSON tree
  • userAgent $userAgent: The User-Agent to find properties for
  • idProperties $idProperties: The results of the tree walk, map of property id to value id
  • propertyId $typedValues: The property that we want to find
  • typedValues $propertyId: Whether to return typed values or string values
static method getProperty (line 215)

Get a specific property using the User-Agent rules

  • return: Hashmap of properties or NULL if there are no properties
  • access: public
static The getProperty (tree &$tree, userAgent $userAgent, idProperties $idProperties, propertyId $propertyId, typedValues $typedValues)
  • tree &$tree: The main JSON tree
  • userAgent $userAgent: The User-Agent to find properties for
  • idProperties $idProperties: The results of the tree walk, map of property id to value id
  • propertyId $propertyId: The property that we want to find
  • typedValues $typedValues: Whether to return typed values or string values
static method getRequiredProperties (line 198)

Get a list of all the required properties that are needed for this class to properly run its rules.

  • return: list of required properties.
  • access: public
static The getRequiredProperties (tree &$tree)
  • tree &$tree: The main JSON tree
static method init (line 54)

Initialise the uar branch of the tree to speed up detection. This method does the following:

1: Extracts out all the property IDs to assist the Api.getProperty() method.

2: Counts the rule sets to avoid doing it on every request.

3: Replaces the default regexes with any API specific ones.

  • access: public
static void init (tree &$tree)
  • tree &$tree: The main JSON tree
static method isUaProp (line 178)

Check if the property is used in the rules and so can be found from them.

This is used in Api.getProperty() to avoid calling the methods in the class if the property that is being looked for cannot be found here.

  • return: if the propertyId is used, FALSE otherwise
  • access: public
static TRUE isUaProp (tree &$tree, propertyId $propertyId)
  • tree &$tree: The main JSON tree
  • propertyId $propertyId: The ID of the property that is sought

Documentation generated on Thu, 06 Oct 2011 16:30:02 +0100 by phpDocumentor 1.4.0