Deviceoptimizer.php

Functions

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

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

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

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

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