TOP

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

Methods

__construct

Mobi_Mtld_DA_CacheProvider_ApcCacheProvider $obj = new Mobi_Mtld_DA_CacheProvider_ApcCacheProvider(
    int cacheItemExpiry=86400
)

Construct a CacheProvider object.

Arguments

    cacheItemExpiry=86400 (int)
    number of seconds before a cache item is expired

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