Class CacheEngine
Storage engine for CakePHP caching
Direct Subclasses
Package: cake\cake\libs
Copyright: Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
License: License (http://www.opensource.org/licenses/mit-license.php)
Location: cache.php
Copyright: Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
License: License (http://www.opensource.org/licenses/mit-license.php)
Location: cache.php
Properties summary
-
$settings
publicinteger
Settings of current engine instance
Method Summary
-
clear() public
Delete all keys from the cache -
decrement() public
Decrement a number under the key and return decremented value -
delete() public
Delete a key from the cache -
gc() public
Garbage collection -
increment() public
Increment a number under the key and return incremented value -
init() public
Initialize the cache engine -
key() public
Generates a safe key for use with cache engine storage engines. -
read() public
Read a key from the cache -
settings() public
Cache Engine settings -
write() public
Write value for a key into cache
Method Detail
clear() public ¶
clear( boolean $check )
Delete all keys from the cache
Parameters
- boolean $check
- if true will check expiration, otherwise delete all
Returns
boolean
True if the cache was succesfully cleared, false otherwise
True if the cache was succesfully cleared, false otherwise
decrement() public ¶
decrement( string $key , integer $offset = 1 )
Decrement a number under the key and return decremented value
Parameters
- string $key
- Identifier for the data
- integer $offset optional 1
- $value How much to substract
Returns
New
incremented value, false otherwise
incremented value, false otherwise
delete() public ¶
delete( string $key )
Delete a key from the cache
Parameters
- string $key
- Identifier for the data
Returns
boolean
True if the value was succesfully deleted, false if it didn't exist or couldn't be removed
True if the value was succesfully deleted, false if it didn't exist or couldn't be removed
increment() public ¶
increment( string $key , integer $offset = 1 )
Increment a number under the key and return incremented value
Parameters
- string $key
- Identifier for the data
- integer $offset optional 1
- How much to add
Returns
New
incremented value, false otherwise
incremented value, false otherwise
init() public ¶
init( array $settings = array() )
Initialize the cache engine
Called automatically by the cache frontend
Parameters
- array $settings optional array()
- $params Associative array of parameters for the engine
Returns
boolean
True if the engine has been succesfully initialized, false if not
True if the engine has been succesfully initialized, false if not
key() public ¶
key( string $key )
Generates a safe key for use with cache engine storage engines.
Parameters
- string $key
- the key passed over
Returns
mixed
string $key or false
string $key or false
read() public ¶
read( string $key )
Read a key from the cache
Parameters
- string $key
- Identifier for the data
Returns
mixed
The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it
The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it
write() public ¶
write( string $key , mixed $value , mixed $duration )
Write value for a key into cache
Parameters
- string $key
- Identifier for the data
- mixed $value
- Data to be cached
- mixed $duration
- How long to cache the data, in seconds
Returns
boolean
True if the data was succesfully cached, false on failure
True if the data was succesfully cached, false on failure