Application
Interfaces, Classes and Traits
- DownloadAndLoadTaskFailureCallback
- DeviceAtlasApi
- 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.
- BaseDeviceAtlasApi
- 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.
- DataFile
- DataFileBuilder
- DataFileDecompressor
- Decompresses a data file. Supports zip and gzip compression.
- DataFileDownloader
- Downloads the data file from a provided URL.
- DataFileManager
- DataMetaFile
- Meta file is used to know when the last data file download/load occurred. This is important for scheduling the download/load task.
- Util
- Mobi_Mtld_DA_DataType
- The data types for various properties. Each Property object returned has a getDataType() method.
- 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.
Table of Contents
- optimizeDataFile() : mixed
- Optimize a DeviceAtlas JSON data file and populate the cache. The API will use the latest optimized cached files.
- clearOptimizationCache() : mixed
- Clear all files and directories which contain DeviceAtlas cached/temp files.
- analysePerformance() : mixed
- Analyse speed and memory performance before.
- analyseOptimizedPerformance() : mixed
- getUas() : mixed
Functions
optimizeDataFile()
Optimize a DeviceAtlas JSON data file and populate the cache. The API will use the latest optimized cached files.
optimizeDataFile(mixed $jsonDataFilePath[, mixed $tempDir = null ][, mixed $force = false ]) : mixed
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 : mixed
- $tempDir : mixed = null
- $force : mixed = false
Return values
mixed —clearOptimizationCache()
Clear all files and directories which contain DeviceAtlas cached/temp files.
clearOptimizationCache([mixed $tempDir = null ]) : mixed
Parameters
- $tempDir : mixed = null
Return values
mixed —analysePerformance()
Analyse speed and memory performance before.
analysePerformance(mixed $jsonDataFilePath[, mixed $tempDir = null ]) : mixed
Parameters
- $jsonDataFilePath : mixed
- $tempDir : mixed = null
Return values
mixed —analyseOptimizedPerformance()
analyseOptimizedPerformance(mixed $jsonDataFilePath[, mixed $tempDir = null ]) : mixed
Parameters
- $jsonDataFilePath : mixed
- $tempDir : mixed = null
Return values
mixed —getUas()
getUas() : mixed