FacturaScripts

MemcacheAdapter implements AdaptorInterface

Class to connect and interact with memcache.

Table of Contents

$connected True if connected, or False when not bool
$memcache Memcache object Memcache
__construct() MemcacheAdaptor constructor. mixed
clear() Flush all cache. bool
delete() Delete data from cache. bool
get() Get the data associated with a key. mixed
isConnected() Return if is connected or not. bool
set() Put content into the cache. bool
toolBox() ToolBox

Properties

$connected

True if connected, or False when not

private static bool $connected

Methods

__construct()

MemcacheAdaptor constructor.

public __construct( ) : mixed

If Memcache can't be used, default option is FileCache

Return values
mixed

clear()

Flush all cache.

public clear( ) : bool
Return values
bool

always true

delete()

Delete data from cache.

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

true if the data was removed successfully

get()

Get the data associated with a key.

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

the content you put in, or null if expired or not found

isConnected()

Return if is connected or not.

public isConnected( ) : bool
Return values
bool

set()

Put content into the cache.

public set( $key : string , $content : mixed , $expire : int ) : bool
Parameters
$key : string
$content : mixed

the the content you want to store

$expire : int

time to expire

Return values
bool

whether if the operation was successful or not

Search results