◆ __construct()
◆ clear()
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 successfully cleared, false otherwise @access public
◆ config()
config |
( |
|
$name = 'default' , |
|
|
|
$settings = array() |
|
) |
| |
Set the cache configuration to use
- Parameters
-
string | array | $name | Name of the configuration |
array | $settings | Optional associative array of settings passed to the engine |
- Returns
- array|false (engine, settings) on success, false on failure @access public
◆ delete()
static 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 successfully deleted, false if it didn't exist or couldn't be removed @access public
◆ engine()
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 @access public
◆ gc()
Garbage collection
Permanently remove all expired and deleted data
@access public
◆ getInstance()
Returns a singleton instance
- Returns
- object @access public
◆ isInitialized()
isInitialized |
( |
|
$engine = null | ) |
|
Check if Cache has initialized a working storage engine
- Parameters
-
string | $engine | Name of the engine |
- Returns
- bool
◆ key()
generates a safe key
- Parameters
-
string | $key | the 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 | $key | Identifier for the data |
string | array | $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 @access public
◆ settings()
settings |
( |
|
$engine = null | ) |
|
Return the settings for current cache engine
- Parameters
-
string | $engine | Name of the engine |
- Returns
- array list of settings for this engine @access public
◆ write()
static write |
( |
|
$key, |
|
|
|
$value, |
|
|
|
$duration = 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 |
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 @access public
◆ $engine
The documentation for this class was generated from the following file: