PHP Class Phergie_Plugin_Cache, phergie

Inheritance: extends Phergie_Plugin_Abstract
Exibir arquivo Open project: phergie/phergie Class Usage Examples

Protected Properties

Property Type Description
$cache array Key-value data storage for the cache

Public Methods

Method Description
expire ( string $key ) : boolean Expires a value that has exceeded its time to live.
fetch ( string $key ) : mixed Fetches a previously stored value.
store ( string $key, mixed $data, integer | null $ttl = 3600, boolean $overwrite = true ) : boolean Stores a value in the cache.

Method Details

expire() public method

Expires a value that has exceeded its time to live.
public expire ( string $key ) : boolean
$key string Key associated with the value to expire
return boolean

fetch() public method

Fetches a previously stored value.
public fetch ( string $key ) : mixed
$key string Key associated with the value
return mixed Stored value or FALSE if no value or an expired value is associated with the specified key

store() public method

Stores a value in the cache.
public store ( string $key, mixed $data, integer | null $ttl = 3600, boolean $overwrite = true ) : boolean
$key string Key to associate with the value
$data mixed Data to be stored
$ttl integer | null Time to live in seconds or NULL for forever
$overwrite boolean TRUE to overwrite any existing value associated with the specified key
return boolean

Property Details

$cache protected_oe property

Key-value data storage for the cache
protected array $cache
return array