API_ID
API_ID = '1'
This class is used by the main API class and should not be used directly.
__construct( $config)
Create the JSON tree handler.
$config |
setConfig(\type $config)
Set new config settings via a new Config object.
\type | $config |
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 1275getDataVersion()
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 1275getDataCreationTimestamp()
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 1275getDataRevision()
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( $userAgent, $stockUserAgents, $clientside)
Get properties from tree walk/ua/client-side and put them in the tree.properties use cached properties if exists.
$userAgent | ||
$stockUserAgents | ||
$clientside |
putTreeWalkProperties( $userAgent, $stockUserAgents = null)
Get properties from tree walk/ua and put them in the tree.properties
if stockUserAgents != null
use userAgent for detecting the ua-props
if stockUserAgents == null
$userAgent | ||
$stockUserAgents |
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'tree' or 'optimized tree' or 'cache'
populateCache( $jsonDataFilePath, $force = false) : boolean
Break down the DeviceAtlas JSON data file into smaller files and save the batch into "/da-api-temp-dir/batch-cache-dir".
$jsonDataFilePath | ||
$force |
true=populated json batch cache files
clearCache()
Remove all tree optimization cache files
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 1275seekProperties( $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
$node | ||
$string | ||
$props2Vals | ||
$matched | ||
$regexRules |
__loadTreeFromFile()
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
loadCachedTreeRoot()
try to load the root cached json file, if not exists try to load and populate the original
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__populateCache( $force = true)
for internal cache populations usages
$force |
cleanup()
Remove the old batches and create the new root json.
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 1275getFileId( $filePath)
Get a unique identifier a json-file e.g. (filetime, filesize), to know when the file is changed
$filePath |
fixValues( $node)
Swap value ids with values in a tree node
$node |
cacheTree( $tree, $depth)
Break down tree and save to files.
$tree | ||
$depth |
throwFileWrite( $path)
Throw a file/directory write exception
$path |
rmdir( $dir)
Recursively remove files and dirs.
$dir |