Cache Class Reference

Public Member Functions | |
| clear ($check=false, $config=null) | |
| config ($name=null, $settings=array()) | |
| delete ($key, $config=null) | |
| engine ($name= 'File', $settings=array()) | |
| gc () | |
| & | getInstance () |
| isInitialized ($engine=null) | |
| read ($key, $config=null) | |
| settings ($engine=null) | |
| write ($key, $value, $duration=null) | |
Public Attributes | |
| $_Engine = null | |
Detailed Description
Definition at line 37 of file cache.php.
Member Function Documentation
| Cache::clear | ( | $ | check = false, |
|
| $ | config = null | |||
| ) |
Delete all keys from the cache
- Parameters:
-
boolean $check if true will check expiration, otherwise delete all string $config name of the configuration to use
- Returns:
- boolean True if the cache was succesfully cleared, false otherwise public
Definition at line 291 of file cache.php.
References $config, getInstance(), and isInitialized().
| Cache::config | ( | $ | name = null, |
|
| $ | settings = array() | |||
| ) |
Set the cache configuration to use
- See also:
- app/config/core.php for configuration settings
- Parameters:
-
string $name Name of the configuration array $settings Optional associative array of settings passed to the engine
- Returns:
- array(engine, settings) on success, false on failure public
Definition at line 97 of file cache.php.
References engine(), getInstance(), and settings().
| Cache::delete | ( | $ | key, | |
| $ | config = null | |||
| ) |
Delete a key from the cache
- Parameters:
-
string $key Identifier for the data string $config name of the configuration to use
- Returns:
- boolean True if the value was succesfully deleted, false if it didn't exist or couldn't be removed public
Definition at line 265 of file cache.php.
References $config, getInstance(), and isInitialized().
| Cache::engine | ( | $ | name = 'File', |
|
| $ | settings = array() | |||
| ) |
Set the cache engine to use or modify settings for one instance
- Parameters:
-
string $name Name of the engine (without 'Engine') array $settings Optional associative array of settings passed to the engine
- Returns:
- boolean True on success, false on failure public
Definition at line 140 of file cache.php.
References getInstance(), Configure::read(), and settings().
Referenced by config(), isInitialized(), and settings().
| Cache::gc | ( | ) |
Garbage collection
Permanently remove all expired and deleted data
public
Definition at line 170 of file cache.php.
References $config, and getInstance().
| & Cache::getInstance | ( | ) |
| Cache::isInitialized | ( | $ | engine = null |
) |
Check if Cache has initialized a working storage engine
- Parameters:
-
string $engine Name of the engine string $config Name of the configuration setting
- Returns:
- bool public
Definition at line 312 of file cache.php.
References engine(), getInstance(), and Configure::read().
| Cache::read | ( | $ | key, | |
| $ | config = null | |||
| ) |
Read a key from the cache
- Parameters:
-
string $key Identifier for the data string $config name of the configuration to use
- Returns:
- mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it public
Definition at line 236 of file cache.php.
References $config, getInstance(), and isInitialized().
Referenced by Configure::corePaths(), App::getInstance(), Configure::listObjects(), DataSource::listSources(), and I18n::translate().
| Cache::settings | ( | $ | engine = null |
) |
| Cache::write | ( | $ | key, | |
| $ | value, | |||
| $ | duration = null | |||
| ) |
Write data for key into cache
- Parameters:
-
string $key Identifier for the data mixed $value Data to be cached - anything except a resource mixed $duration Optional - string configuration name OR how long to cache the data, either in seconds or a string that can be parsed by the strtotime() function OR array('config' => 'default', 'duration' => '3600')
- Returns:
- boolean True if the data was successfully cached, false on failure public
Definition at line 186 of file cache.php.
References $config, getInstance(), ife(), and isInitialized().
Referenced by Configure::corePaths(), and DataSource::listSources().
Member Data Documentation
The documentation for this class was generated from the following file:
- 1.2.x.x/cake/libs/cache.php