Class XoopsCacheFile
File Storage engine for cache
-
XoopsCacheEngine
-
XoopsCacheFile
Methods summary
public
boolean
|
#
init( array $settings = array() )
Initialize the Cache Engine
Initialize the Cache Engine
Called automatically by the cache frontend
To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
Parameters
- $settings
- array of setting for the engine
Returns
boolean True if the engine has been successfully initialized, false if not
Overrides
|
public
boolean
|
#
gc( )
Garbage collection. Permanently remove all expired and deleted data
Garbage collection. Permanently remove all expired and deleted data
Returns
boolean True if garbage collection was successful, false on failure
Overrides
|
public
boolean
|
#
write( string $key, mixed $data = null, mixed $duration = null )
Write data for key into cache
Write data for key into cache
Parameters
- $key
- Identifier for the data
- $data
- Data to be cached
- $duration
- How long to cache the data, in seconds
Returns
boolean True if the data was successfully cached, false on failure
Overrides
|
public
mixed
|
#
read( string $key )
Read a key from the cache
Read a key from the cache
Parameters
- $key
- Identifier for the data
Returns
mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it
Overrides
|
public
boolean
|
#
delete( string $key )
Delete a key from the cache
Delete a key from the cache
Parameters
- $key
- Identifier for the data
Returns
boolean True if the value was successfully deleted, false if it didn't exist or couldn't be removed
Overrides
|
public
boolean
|
#
clear( boolean $check = true )
Delete all values from the cache
Delete all values from the cache
Parameters
- $check
- Optional - only delete expired cache items
Returns
boolean True if the cache was successfully cleared, false otherwise
Overrides
|
Properties summary
public
array
|
$settings
settings
path = absolute path to cache directory, default => CACHE
prefix = string prefix for filename, default => xoops_
lock = enable file locking on write, default => false
serialize = serialize the data, default => false
settings path = absolute path to cache directory, default => CACHE prefix = string prefix for filename, default => xoops_ lock = enable file locking on write, default => false serialize = serialize the data, default => false
See
CacheEngine::__defaults
|
|