PHP Class Redaxscript\Cache

Since: 3.0.0
Author: Henry Ruhs
Mostra file Open project: redaxmedia/redaxscript Class Usage Examples

Protected Properties

Property Type Description
$_directory string directory of the cache
$_extension string extension of the cached files

Public Methods

Method Description
clear ( mixed $bundle = null ) : Cache clear the cache
clearInvalid ( integer $lifetime = 3600 ) : Cache clear the invalid cache
getDirectory ( ) : string get the directory
getPath ( mixed $bundle = null ) : string get the path
init ( string $directory = null, string $extension = null ) : Cache init the class
retrieve ( mixed $bundle = null ) : mixed retrieve from cache
store ( mixed $bundle = null, string $content = null ) : Cache store to cache
validate ( mixed $bundle = null, integer $lifetime = 3600 ) : boolean validate the cache

Protected Methods

Method Description
_getFile ( mixed $bundle = null ) : string get the file
_validateFile ( string $path = null, integer $lifetime = 3600 ) : boolean validate the file

Method Details

_getFile() protected method

get the file
Since: 3.0.0
protected _getFile ( mixed $bundle = null ) : string
$bundle mixed key or collection of the bundle
return string

_validateFile() protected method

validate the file
Since: 3.0.0
protected _validateFile ( string $path = null, integer $lifetime = 3600 ) : boolean
$path string path of the bundle
$lifetime integer lifetime of the bundle
return boolean

clear() public method

clear the cache
Since: 3.0.0
public clear ( mixed $bundle = null ) : Cache
$bundle mixed key or collection of the bundle
return Cache

clearInvalid() public method

clear the invalid cache
Since: 3.0.0
public clearInvalid ( integer $lifetime = 3600 ) : Cache
$lifetime integer lifetime of the bundle
return Cache

getDirectory() public method

get the directory
Since: 3.0.0
public getDirectory ( ) : string
return string

getPath() public method

get the path
Since: 3.0.0
public getPath ( mixed $bundle = null ) : string
$bundle mixed key or collection of the bundle
return string

init() public method

init the class
Since: 3.0.0
public init ( string $directory = null, string $extension = null ) : Cache
$directory string directory of the cache
$extension string extension of the cached files
return Cache

retrieve() public method

retrieve from cache
Since: 3.0.0
public retrieve ( mixed $bundle = null ) : mixed
$bundle mixed key or collection of the bundle
return mixed

store() public method

store to cache
Since: 3.0.0
public store ( mixed $bundle = null, string $content = null ) : Cache
$bundle mixed key or collection of the bundle
$content string content of the bundle
return Cache

validate() public method

validate the cache
Since: 3.0.0
public validate ( mixed $bundle = null, integer $lifetime = 3600 ) : boolean
$bundle mixed key or collection of the bundle
$lifetime integer lifetime of the bundle
return boolean

Property Details

$_directory protected_oe property

directory of the cache
protected string $_directory
return string

$_extension protected_oe property

extension of the cached files
protected string $_extension
return string