TOP

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.
Source
FileCacheProvider.php
Implements
Mobi_Mtld_DA_CacheProvider_CacheProviderInterface
Package
Mobi\Mtld\DA\Device\CacheProvider
Author
DeviceAtlas Limited

Methods

__construct

Mobi_Mtld_DA_CacheProvider_FileCacheProvider $obj = new Mobi_Mtld_DA_CacheProvider_FileCacheProvider(
    int cacheItemExpiry=86400,
    string cacheDir=system-temp-dir
)

Construct a CacheProvider object.

Arguments

    cacheItemExpiry=86400 (int)
    number of seconds before a cache item is expired
    cacheDir=system-temp-dir (string)
    temp directory to place the cached files in

Returns

void

clear

bool $obj->clear()

Clear the whole cache.

Returns

bool
true=cache cleared

delete

bool $obj->delete(string key)

Remove an item from the cache.

Arguments

    key (string)
    cache key

Returns

bool
true=cache deleted

get

mixed $obj->get(string key)

Get a stored value form cache.

Arguments

    key (string)
    cache key

Returns

mixed
the cached value or null if the key does not exist in cache

set

bool $obj->set(string key)

Store a value in cache.

Value
mixed value value to be set to the cache key

Arguments

    key (string)
    cache key

Returns

bool
true=cache stored