PHP Class StackFormation\Helper\Cache

Quick'n'dirty cache with convenience method Example: $cache->get('message', function() { return 'Hello World'; }); Will return the message from cache if present and will generate it by executing the callback and store it in the cache before returning the value.
Author: Fabrizio Branca
Mostra file Open project: aoepeople/stackformation Class Usage Examples

Protected Properties

Property Type Description
$cache

Public Methods

Method Description
delete ( $key ) Delete
get ( $key, callable $callback = null, boolean $fresh = false ) : mixed Get (and generate)
has ( $key ) : boolean Has
set ( $key, $value ) Set

Method Details

delete() public method

Delete
public delete ( $key )
$key

get() public method

Get (and generate)
public get ( $key, callable $callback = null, boolean $fresh = false ) : mixed
$key
$callback callable
$fresh boolean
return mixed

has() public method

Has
public has ( $key ) : boolean
$key
return boolean

set() public method

Set
public set ( $key, $value )
$key
$value

Property Details

$cache protected_oe property

protected $cache