Class cFileCache
This class contains functions for the CONTENIDO file cache.
Methods summary
public
|
#
__construct( array $options = array() )
Constructor to create an instance of this class.
Constructor to create an instance of this class.
Parameters
- $options
array $options [optional] array with options for the cache (optional, default: empty
array)
|
public
|
#
setOptions( array $options )
Setter for the cache options.
Setter for the cache options.
Validates incoming options and sets the default of the missing options.
Parameters
- $options
array $options array with option
|
public
string
|
#
generateFileName( string $id, string $group = '' )
Generates the filename based on set options.
Generates the filename based on set options.
Parameters
- $id
string $id cache ID
- $group
string $group [optional] cache group
Returns
string filename
|
protected
|
#
_validateDirectory( )
Validates the caching directory and throws exception on error.
Validates the caching directory and throws exception on error.
Throws
|
public
string
|
#
getDestination( string $id, string $group = '' )
Returns full destination to the cached file.
Returns full destination to the cached file.
Parameters
- $id
string $id cache ID
- $group
string $group [optional] cache group
Returns
string full filename
Throws
|
public
boolean|string
|
#
get( string $id, string $group = '' )
Return content of a specific cache stored in filesystem.
Return content of a specific cache stored in filesystem.
If not cached, false is returned.
Parameters
- $id
string $id cache ID
- $group
string $group [optional] cache group
Returns
boolean|string content or false
Throws
|
public
boolean
|
#
save( string $data, string $id, string $group = '' )
Saves the content of a cache in filesystem.
Saves the content of a cache in filesystem.
Parameters
- $data
string $data data to save
- $id
string $id cache ID
- $group
string $group [optional] cache group
Returns
boolean success state
Throws
|
public
boolean
|
#
remove( string $id, string $group = '' )
Removes cache from filesystem.
Removes cache from filesystem.
Parameters
- $id
string $id cache ID
- $group
string $group [optional] cache group
Returns
boolean success state
Throws
|
public
string
|
#
generateID( mixed $variables )
Generates a ID for the given variables.
Generates a ID for the given variables.
Parameters
- $variables
mixed $variables variables to generate a ID for
Returns
string generated ID
|
Properties summary
protected
array
|
$_options
|
array() |
|