Cache Class Reference

Inheritance diagram for Cache:

Object List of all members.

Public Member Functions

 __loadEngine ($name)

Static 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)
 set ($settings=array(), $value=null)
 settings ($engine=null)
 write ($key, $value, $config=null)

Public Attributes

 $__config = array()
 $__name = 'default'
 $__reset = false
 $_Engine = null

Detailed Description

Definition at line 32 of file cache.php.


Member Function Documentation

Cache::__loadEngine ( name  ) 

Tries to find and include a file for a cache engine and returns object instance

Parameters:
$name Name of the engine (without 'Engine')
Returns:
mixed $engine object or null private

Definition at line 82 of file cache.php.

References cache().

Referenced by engine().

Cache::clear ( check = false,
config = null 
) [static]

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 343 of file cache.php.

References $config, getInstance(), and isInitialized().

Cache::config ( name = null,
settings = array() 
) [static]

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 98 of file cache.php.

References engine(), getInstance(), isInitialized(), and settings().

Referenced by Configure::__loadBootstrap().

Cache::delete ( key,
config = null 
) [static]

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 309 of file cache.php.

References $config, getInstance(), and isInitialized().

Cache::engine ( name = 'File',
settings = array() 
) [static]

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 144 of file cache.php.

References __loadEngine(), getInstance(), and settings().

Referenced by config(), gc(), isInitialized(), set(), and settings().

Cache::gc (  )  [static]

Garbage collection

Permanently remove all expired and deleted data

Returns:
void public

Definition at line 209 of file cache.php.

References $config, engine(), and getInstance().

Referenced by __close().

& Cache::getInstance (  )  [static]

Returns a singleton instance

Returns:
object public

Definition at line 68 of file cache.php.

Referenced by clear(), config(), delete(), engine(), gc(), isInitialized(), read(), set(), settings(), and write().

Cache::isInitialized ( engine = null  )  [static]

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 372 of file cache.php.

References engine(), getInstance(), and Configure::read().

Referenced by clear(), config(), delete(), read(), and write().

Cache::read ( key,
config = null 
) [static]

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 273 of file cache.php.

References $config, getInstance(), and isInitialized().

Referenced by DataSource::__cacheDescription(), App::__find(), Configure::corePaths(), App::getInstance(), Configure::listObjects(), DataSource::listSources(), and I18n::translate().

Cache::set ( settings = array(),
value = null 
) [static]

Temporarily change settings to current config options. if no params are passed, resets settings if needed Cache::write() will reset the configuration changes made

Parameters:
mixed $settings Optional string for simple name-value pair or array
string $value Optional for a simple name-value pair
Returns:
array of settings public

Definition at line 173 of file cache.php.

References engine(), and getInstance().

Cache::settings ( engine = null  )  [static]

Return the settings for current cache engine

Parameters:
string $engine Name of the engine
Returns:
array list of settings for this engine public

Definition at line 391 of file cache.php.

References engine(), and getInstance().

Referenced by config(), and engine().

Cache::write ( key,
value,
config = null 
) [static]

Write data for key into cache

Parameters:
string $key Identifier for the data
mixed $value Data to be cached - anything except a resource
string $config Optional - string configuration name
Returns:
boolean True if the data was successfully cached, false on failure public

Definition at line 224 of file cache.php.

References $config, getInstance(), and isInitialized().

Referenced by DataSource::__cacheDescription(), App::__destruct(), Configure::__destruct(), I18n::__destruct(), Configure::corePaths(), and DataSource::listSources().


Member Data Documentation

Cache::$__config = array()

Definition at line 46 of file cache.php.

Cache::$__name = 'default'

Definition at line 53 of file cache.php.

Cache::$__reset = false

Definition at line 60 of file cache.php.

Cache::$_Engine = null

Definition at line 39 of file cache.php.


The documentation for this class was generated from the following file:
Generated on Sun Nov 22 00:30:55 2009 for CakePHP 1.2.x.x (v1.2.4.8284) by doxygen 1.4.7