Documentation

Mobi_Mtld_DA_CacheProvider_MemCacheProvider implements Mobi_Mtld_DA_CacheProvider_CacheProviderInterface

Memcache 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.

Tags
author

DeviceAtlas Limited

copyright

Copyright (c) DeviceAtlas Limited 2021. All Rights Reserved. https://deviceatlas.com

Interfaces, Classes and Traits

Mobi_Mtld_DA_CacheProvider_CacheProviderInterface
A cache provider such as APC or Memcache 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. A valid cache provider must implement this interface to be usable by the APIs.

Table of Contents

IS_MEMCACHE  = 1
IS_MEMCACHED  = 2
$cacheItemExpiry  : mixed
$extensionType  : mixed
$memcache  : mixed
__construct()  : mixed
Construct a CacheProvider object.
clear()  : bool
Clear the whole cache.
delete()  : bool
Remove an item from the cache.
get()  : mixed
Get a stored value form cache.
set()  : bool
Store a value in cache.

Constants

Properties

Methods

__construct()

Construct a CacheProvider object.

public __construct([mixed $cacheItemExpiry = 86400 ][, mixed $host = 'localhost' ][, mixed $port = 11211 ][, mixed $pconnect = false ]) : mixed
Parameters
$cacheItemExpiry : mixed = 86400
$host : mixed = 'localhost'
$port : mixed = 11211
$pconnect : mixed = false
Return values
mixed

clear()

Clear the whole cache.

public clear() : bool
Return values
bool

true=cache cleared

delete()

Remove an item from the cache.

public delete(mixed $key) : bool
Parameters
$key : mixed
Return values
bool

true=cache deleted

get()

Get a stored value form cache.

public get(mixed $key) : mixed
Parameters
$key : mixed
Return values
mixed

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

set()

Store a value in cache.

public set(mixed $key, mixed $value) : bool
Parameters
$key : mixed
$value : mixed
Tags
value

mixed value value to be set to the cache key

Return values
bool

true=cache stored

Search results