XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
XoopsCache Class Reference

Public Member Functions

 __construct ()
 
 clear ($check=false, $config=null)
 
 config ($name= 'default', $settings=array())
 
 delete ($key, $config=null)
 
 engine ($name= 'file', $settings=array())
 
 gc ()
 
 isInitialized ($engine=null)
 
 key ($key)
 
 loadEngine ($name)
 
 settings ($engine=null)
 
 write ($key, $value, $duration=null)
 

Static Public Member Functions

static & getInstance ()
 
static read ($key, $config=null)
 

Public Attributes

 $configs = array()
 
 $engine = null
 
 $name = null
 

Detailed Description

Definition at line 28 of file xoopscache.php.

Constructor & Destructor Documentation

XoopsCache::__construct ( )

XoopsCache::__construct()

Definition at line 59 of file xoopscache.php.

Member Function Documentation

XoopsCache::clear (   $check = false,
  $config = null 
)

Delete all keys from the cache

Parameters
boolean$checkif true will check expiration, otherwise delete all
string$configname of the configuration to use
Returns
boolean True if the cache was succesfully cleared, false otherwise public

Definition at line 320 of file xoopscache.php.

References getInstance().

Here is the call graph for this function:

XoopsCache::config (   $name = 'default',
  $settings = array() 
)

Set the cache configuration to use

Parameters
string$nameName of the configuration
array$settingsOptional associative array of settings passed to the engine
Returns
array (engine, settings) on success, false on failure public

Definition at line 107 of file xoopscache.php.

References getInstance().

Here is the call graph for this function:

XoopsCache::delete (   $key,
  $config = null 
)

Delete a key from the cache

Parameters
string$keyIdentifier for the data
string$configname 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 291 of file xoopscache.php.

References getInstance().

Referenced by mod_clearConfig().

Here is the call graph for this function:

Here is the caller graph for this function:

XoopsCache::engine (   $name = 'file',
  $settings = array() 
)

Set the cache engine to use or modify settings for one instance

Parameters
string$nameName of the engine (without 'Engine')
array$settingsOptional associative array of settings passed to the engine
Returns
boolean True on success, false on failure public

Definition at line 156 of file xoopscache.php.

References getInstance().

Here is the call graph for this function:

XoopsCache::gc ( )

Garbage collection

Permanently remove all expired and deleted data

public

Definition at line 190 of file xoopscache.php.

References $config, and getInstance().

Here is the call graph for this function:

static& XoopsCache::getInstance ( )
static

Returns a singleton instance

Returns
object public

Definition at line 69 of file xoopscache.php.

Referenced by xos_logos_PageBuilder\buildBlock(), clear(), config(), delete(), engine(), gc(), isInitialized(), read(), xos_opal_Theme\render(), settings(), and write().

Here is the caller graph for this function:

XoopsCache::isInitialized (   $engine = null)

Check if Cache has initialized a working storage engine

Parameters
string$engineName of the engine
string$configName of the configuration setting
Returns
bool public

Definition at line 342 of file xoopscache.php.

References getInstance().

Here is the call graph for this function:

XoopsCache::key (   $key)

generates a safe key

Parameters
string$keythe key passed over
Returns
mixed string $key or false private

Definition at line 378 of file xoopscache.php.

XoopsCache::loadEngine (   $name)

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

Parameters
$nameName of the engine
Returns
mixed $engine object or null private

Definition at line 86 of file xoopscache.php.

References $file.

static XoopsCache::read (   $key,
  $config = null 
)
static

Read a key from the cache

Parameters
string$keyIdentifier for the data
string$configname 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 260 of file xoopscache.php.

References $config, and getInstance().

Referenced by XoopsCaptchaImageHandler\getList(), XoopsEditorHandler\getList(), XoopsObject\loadFilters(), mod_loadConfig(), mod_loadFile(), XoopsPreload\setPreloads(), and xoops_getActiveModules().

Here is the call graph for this function:

Here is the caller graph for this function:

XoopsCache::settings (   $engine = null)

Return the settings for current cache engine

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

Definition at line 359 of file xoopscache.php.

References getInstance().

Here is the call graph for this function:

XoopsCache::write (   $key,
  $value,
  $duration = null 
)

Write data for key into cache

Parameters
string$keyIdentifier for the data
mixed$valueData to be cached - anything except a resource
mixed$durationOptional - 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 208 of file xoopscache.php.

References $config, and getInstance().

Referenced by XoopsCaptchaImageHandler\getList(), XoopsEditorHandler\getList(), XoopsObject\loadFilters(), mod_createFile(), mod_loadConfig(), and xoops_setActiveModules().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

XoopsCache::$configs = array()

Definition at line 46 of file xoopscache.php.

XoopsCache::$engine = null

Definition at line 36 of file xoopscache.php.

XoopsCache::$name = null

Definition at line 54 of file xoopscache.php.


The documentation for this class was generated from the following file: