Class cFileCache
This class contains functions for the file cache in CONTENIDO.
Methods summary
public
|
#
__construct( array $options = array() )
Constructor.
Parameters
- $options
array $options array with options for the cache (optional, default: empty array)
|
public
|
#
setOptions( array $options )
Setter for the cache options. Validates incoming options and sets the default
of the missing 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 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 cache file.
Returns full destination to the cache file.
Parameters
- $id
string $id cache ID
- $group
string $group cache group
Returns
string full filename
|
public
boolean|string
|
#
get( string $id, string $group = '' )
Return content of a specific cache stored in filesystem. If not cached, false
is returned.
Return content of a specific cache stored in filesystem. If not cached, false
is returned.
Parameters
- $id
string $id cache ID
- $group
string $group cache group
Returns
boolean|string content or false
|
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 cache group
Returns
boolean success state
|
public
boolean
|
#
remove( string $id, string $group = '' )
Removes cache from filesystem.
Removes cache from filesystem.
Parameters
- $id
string $id cache ID
- $group
string $group cache group
Returns
boolean success state
|
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() |
|