Properties

$_cachepath

$_cachepath : string

The path to the cache file folder.

Type

string

$_cachename

$_cachename : string

The name of the default cache file.

Type

string

$_extension

$_extension : string

The cache file extension.

Type

string

$_useCaching

$_useCaching : boolean

Caching enabled/disabled.

Type

boolean

$_cachedData

$_cachedData : array

Cached data.

Type

array

$_fileLoaded

$_fileLoaded : boolean

File loaded flag, to prevent reading the file more than once.

Type

boolean

Methods

__construct()

__construct(  $config = null) 

Default constructor.

Parameters

$config

isCached()

isCached(string  $key) : boolean

Check whether data accociated with a key.

Parameters

string $key

Returns

boolean

store()

store(string  $key, mixed  $data,   $expiration) : object

Store data in the cache.

Parameters

string $key
mixed $data
$expiration

Returns

object

retrieve()

retrieve(string  $key,   $timestamp = false) : string

Retrieve cached data by its key.

Parameters

string $key
$timestamp

Returns

string

retrieveAll()

retrieveAll(  $meta = false) : array

Retrieve all cached data.

Parameters

$meta

Returns

array

erase()

erase(string  $key) : object

Erase cached entry by its key.

Parameters

string $key

Returns

object

eraseExpired()

eraseExpired() : integer

Erase all expired entries.

Returns

integer

eraseAll()

eraseAll() : object

Erase all cached entries.

Returns

object

getCacheDir()

getCacheDir() : string

Get the cache directory path.

Returns

string

setCachePath()

setCachePath(string  $path) : object

Cache path Setter.

Parameters

string $path

Returns

object

getCachePath()

getCachePath() : string

Cache path Getter.

Returns

string

setCache()

setCache(string  $name) : object

Cache name Setter.

Parameters

string $name

Returns

object

getCache()

getCache() 

Cache name Getter.

get_cache_lang()

get_cache_lang() : string

Cache language Getter.

Returns

string

setExtension()

setExtension(string  $ext) : object

Cache file extension Setter.

Parameters

string $ext

Returns

object

getExtension()

getExtension() : string

Cache file extension Getter.

Returns

string

_loadCache()

_loadCache() : mixed

Load appointed cache.

Returns

mixed

_getHash()

_getHash(  $filename) : string

Get the filename hash.

Parameters

$filename

Returns

string

_checkExpired()

_checkExpired(integer  $timestamp, integer  $expiration) : boolean

Check whether a timestamp is still in the duration.

Parameters

integer $timestamp
integer $expiration

Returns

boolean

_checkCacheDir()

_checkCacheDir() : boolean

Check if a writable cache directory exists and if not create a new one.

Returns

boolean

_refreshCache()

_refreshCache() : string

Get the filename hash.

Returns

string