API - XOOPS 2.5.11 Beta 2
By monxoops.fr
XoopsCache Class Reference

Public Member Functions

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

Static Public Member Functions

static getInstance ()
 
static write ($key, $value, $duration=null)
 
static read ($key, $config=null)
 
static delete ($key, $config=null)
 

Protected Attributes

 $engine
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Member Function Documentation

◆ clear()

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 successfully cleared, false otherwise @access public
Here is the call graph for this function:

◆ config()

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

Set the cache configuration to use

Parameters
string | array$nameName of the configuration
array$settingsOptional associative array of settings passed to the engine
Returns
array|false (engine, settings) on success, false on failure @access public
Here is the call graph for this function:

◆ delete()

static delete (   $key,
  $config = null 
)
static

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 successfully deleted, false if it didn't exist or couldn't be removed @access public
Here is the call graph for this function:
Here is the caller graph for this function:

◆ engine()

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 @access public
Here is the call graph for this function:

◆ gc()

gc ( )

Garbage collection

Permanently remove all expired and deleted data

@access public

Here is the call graph for this function:

◆ getInstance()

static getInstance ( )
static

Returns a singleton instance

Returns
object @access public
Here is the caller graph for this function:

◆ isInitialized()

isInitialized (   $engine = null)

Check if Cache has initialized a working storage engine

Parameters
string$engineName of the engine
Returns
bool
Here is the call graph for this function:

◆ key()

key (   $key)

generates a safe key

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

◆ read()

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

Read a key from the cache

Parameters
string$keyIdentifier for the data
string | array$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 @access public
Here is the call graph for this function:
Here is the caller graph for this function:

◆ settings()

settings (   $engine = null)

Return the settings for current cache engine

Parameters
string$engineName of the engine
Returns
array list of settings for this engine @access public
Here is the call graph for this function:

◆ write()

static write (   $key,
  $value,
  $duration = null 
)
static

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 @access public
Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ $engine

$engine
protected

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