\Pop\Cache\AdapterFile

File adapter cache class

Summary

Methods
Properties
Constants
__construct()
setLifetime()
save()
load()
remove()
clear()
isExpired()
getStart()
getExpiration()
getLifetime()
setDir()
getDir()
delete()
No public properties found
No constants found
No protected methods found
$lifetime
$dir
N/A
No private methods found
No private properties found
N/A

Properties

$lifetime

$lifetime : integer

Cache lifetime

Type

integer

$dir

$dir : string

Cache dir

Type

string

Methods

__construct()

__construct(string  $dir, integer  $lifetime) : \Pop\Cache\Adapter\File

Constructor

Instantiate the cache file object

Parameters

string $dir
integer $lifetime

Returns

\Pop\Cache\Adapter\File

setLifetime()

setLifetime(integer  $lifetime) : \Pop\Cache\Adapter\AbstractAdapter

Set the lifetime.

Parameters

integer $lifetime

Returns

\Pop\Cache\Adapter\AbstractAdapter

save()

save(string  $id, mixed  $value) : \Pop\Cache\Adapter\File

Save a value to cache.

Parameters

string $id
mixed $value

Returns

\Pop\Cache\Adapter\File

load()

load(string  $id) : mixed

Load a value from cache.

Parameters

string $id

Returns

mixed

remove()

remove(string  $id) : \Pop\Cache\Adapter\File

Remove a value in cache.

Parameters

string $id

Returns

\Pop\Cache\Adapter\File

clear()

clear(boolean  $del = false, string  $path = null) : \Pop\Cache\Adapter\File

Clear all stored values from cache.

Parameters

boolean $del
string $path

Returns

\Pop\Cache\Adapter\File

isExpired()

isExpired(string  $id) : boolean

Tell is a value is expired.

Parameters

string $id

Returns

boolean

getStart()

getStart(string  $id) : integer

Get original start timestamp of the value.

Parameters

string $id

Returns

integer

getExpiration()

getExpiration(string  $id) : integer

Get expiration timestamp of the value.

Parameters

string $id

Returns

integer

getLifetime()

getLifetime(string  $id) : integer

Get the lifetime of the value.

Parameters

string $id

Returns

integer

setDir()

setDir(string  $dir) : \Pop\Cache\Adapter\File

Set the current cache dir.

Parameters

string $dir

Throws

\Pop\Cache\Adapter\Exception

Returns

\Pop\Cache\Adapter\File

getDir()

getDir() : string

Get the current cache dir.

Returns

string

delete()

delete(string  $path = null) : \Pop\Cache\Adapter\File

Method to delete the top level directory

Parameters

string $path

Returns

\Pop\Cache\Adapter\File