\

Interfaces

Mobi_Mtld_DA_CacheProvider_CacheProviderInterface A cache provider such as APC or Memcache may be used by the DeviceApi and DeviceApiWeb to cache the detected properties. Using cache improves the performance by not doing unnecessary lookups in the data files. A valid cache provider must implement this interface to be usable by the APIs.

Classes

Mobi_Mtld_DA_Api Used to load the recognition tree and perform lookups of all properties, or individual properties.
Mobi_Mtld_DA_ApiCached This class significantly improves core DA PHP Api performance when used on a standard website with a single detection per request.
Mobi_Mtld_DA_CacheProvider_ApcCacheProvider APC cache provider may be used by the DeviceApi and DeviceApiWeb to cache the detected properties. Using cache improves the performance by not doing unnecessary lookups in the data files.
Mobi_Mtld_DA_CacheProvider_FileCacheProvider File cache provider may be used by the DeviceApi and DeviceApiWeb to cache the detected properties. Using cache improves the performance by not doing unnecessary lookups in the data files.
Mobi_Mtld_DA_CacheProvider_MemCacheProvider Memcache cache provider may be used by the DeviceApi and DeviceApiWeb to cache the detected properties. Using cache improves the performance by not doing unnecessary lookups in the data files.
Mobi_Mtld_DA_CacheProvider_VolatileCacheProvider Volatile cache can be used by the DeviceApi class to cache the detected properties. Using cache improves the performance by not doing unnecessary lookups in the data files.
Mobi_Mtld_DA_Carrier_BucketHandler A bucket is a section of the data file. It has an ID, length and a byte array of data. Each bucket type has a specific format. This class handles the conversion of bucket data(binary bytes) to actual values.
Mobi_Mtld_DA_Carrier_BucketType The types of bucket and their associated IDs. The IDs are important and should **NOT** be changed. The API relies on these IDs remaining the same.
Mobi_Mtld_DA_Carrier_ByteReader This class gets a chunk of binary data (bytes) then the methods are used to read data segments based on the data of data being read from the chunk, the read pointer will advance to the next bytes.
Mobi_Mtld_DA_Carrier_CarrierApi The main class for the Carrier Identification API. Used to load the data file and to perform lookups using IPv4 addresses. For usage in a Web App it is recommended to use the CarrierApiWeb (CarrierApiWeb.php) class so you don't have to pass the client's IP address manually.
Mobi_Mtld_DA_Carrier_CarrierApiWeb A small extension to the core CarrierApi to get IP from $_SERVER for current client.
Mobi_Mtld_DA_Carrier_CarrierData This class is responsible for loading the data file and walking the IPV4 Radix Trie to find the properties for a given User-Agent.
Mobi_Mtld_DA_Carrier_CarrierDataType Carrier API specific data types. These are used to optimise the data in the data file.
Mobi_Mtld_DA_DataType The data types for various properties. Each Property object returned has a getDataType() method.
Mobi_Mtld_DA_Device_ClientProps This class is used by the main API class and should not be used directly.
Mobi_Mtld_DA_Device_Config DeviceApi Configurations. To change the default configs of the DeviceAtlas DeviceApi create an instance of this class, set your preferred configs and pass the instance to the constructor of a DeviceApi or DeviceApiWeb. Note that you may change the configs even after the Config instance has been passed to the DeviceApi.
Mobi_Mtld_DA_Device_DeviceApi The DeviceAtlas device detection API provides a way to detect devices based on the HTTP headers. Using the headers, the API returns device properties such as screen width, screen height, is mobile, vendor, model etc. If you want to use the DeviceAtlas API for web applications then it is recommended to use DeviceApiWeb instead of this library.<br/> The DeviceApiWeb is preferred when you want to get the properties from a real-time detection on user's device in a web application.
Mobi_Mtld_DA_Device_DeviceApiWeb A small extension to the core DeviceApi that uses the request HTTP headers for detection and property lookup.<br/><br/>
Mobi_Mtld_DA_Device_PostWalkRules This class is used by the main API class and should not be used directly.
Mobi_Mtld_DA_Device_Tree This class is used by the main API class and should not be used directly.
Mobi_Mtld_DA_Device_TreeOptimized This class is used by the main API class and should not be used directly.
Mobi_Mtld_DA_Device_UaProps This class is used by the main API class and should not be used directly.
Mobi_Mtld_DA_Exception_ClientPropertiesException The ClientPropertiesException is thrown by the API when there is a problem parsing the properties from the client or when the JSON file does not support client side properties.
Mobi_Mtld_DA_Exception_DataFileException The DataFileException is thrown if there is a problem loading the data file.
Mobi_Mtld_DA_Exception_DataReadException The DataReadException is thrown if there is a problem loading the data from stream.
Mobi_Mtld_DA_Exception_FileWriteException The FileWriteException is thrown if a file or directory can not be created/written. Usually this happens if there are not sufficient permissions.
Mobi_Mtld_DA_Exception_IncorrectPropertyTypeException The InvalidPropertyException is thrown by the Api class when there is an attempt to fetch a property by type and the property is stored under a different type in the tree.
Mobi_Mtld_DA_Exception_InvalidPropertyException The InvalidPropertyException is thrown by the Api class when there is an attempt to fetch a property that is unknown for the supplied user agent.
Mobi_Mtld_DA_Exception_InvalidPropertyNameException The Mobi_Mtld_DA_Exception_InvalidPropertyNameException is thrown when an attempt is made to get a property using a property name that does not exist.
Mobi_Mtld_DA_Exception_JsonException The JsonException is thrown by the Json class or the Api class when there is an error parsing the Json.
Mobi_Mtld_DA_Exception_MissingDataException The Mobi_Mtld_DA_Exception_MissingDataException is thrown if a data file was not loaded before a call to methods like getProperties(ip) or getPropertyNames();
Mobi_Mtld_DA_Exception_UnknownPropertyException The UnknownPropertyException is thrown by the Api class when there is an attempt to fetch a property unknown to the tree.
Mobi_Mtld_DA_Properties Contains a map of names to Property objects. An instance of this class is returned by getProperties().
Mobi_Mtld_DA_Property Contains a property value. The value can be fetched as a generic Object or one of the convenience asXXXX methods can be used to get the value in a specific type.
Mobi_Mtld_DA_PropertyName Contains a property name and the expected data type of values associated with this name.

Functions

analyseOptimizedPerformance()

analyseOptimizedPerformance(  $jsonDataFilePath,   $tempDir = null) 

Parameters

$jsonDataFilePath
$tempDir
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

analysePerformance()

analysePerformance(  $jsonDataFilePath,   $tempDir = null) 

Analyse speed and memory performance before.

Parameters

$jsonDataFilePath
$tempDir
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

clearOptimizationCache()

clearOptimizationCache(  $tempDir = null) 

Clear all files and directories which contain DeviceAtlas cached/temp files.

Parameters

$tempDir
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

getUas()

getUas() 

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

optimizeDataFile()

optimizeDataFile(  $jsonDataFilePath,   $tempDir = null,   $force = false) 

Optimize a DeviceAtlas JSON data file and populate the cache. The API will use the latest optimized cached files.

Note that when using the API (configured to use optimized data file), when a new data file is passed to the API "loadDataFromFile()" method if the file is not optimized it will automatically be optimized. However this will cause a small lag for the request which the optimization is done at. The bellow function may be used instead.

Parameters

$jsonDataFilePath
$tempDir
$force
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