PHP Class FileStorage, HamlPHP

Author: David Grudl
Inheritance: extends Object, implements ICacheStorage
Show file Open project: hamlphp/hamlphp Class Usage Examples

Protected Properties

Property Type Description
$_basePath
$_extension
$_path
$_requirePath

Public Methods

Method Description
__construct ( string $cachePath, string $extension = '.cached.php', string $basePath = '' ) Contructor
cache ( $id, $content )
fetch ( $id )
generateContentId ( $filepath )
isFresh ( $id, $fileName = false )
remove ( $id )

Method Details

__construct() public method

The param \c $basePath param is used to shorten the unique filename which is generated using the file real path.
public __construct ( string $cachePath, string $extension = '.cached.php', string $basePath = '' )
$cachePath string where to save the cache files
$extension string the extension of the cache file
$basePath string The base path from where the files come from

cache() public method

See also: Storage::cache()
public cache ( $id, $content )

fetch() public method

See also: Storage::fetch()
public fetch ( $id )

generateContentId() public method

public generateContentId ( $filepath )

isFresh() public method

See also: Storage::isFresh()
public isFresh ( $id, $fileName = false )

remove() public method

See also: Storage::remove()
public remove ( $id )

Property Details

$_basePath protected property

protected $_basePath

$_extension protected property

protected $_extension

$_path protected property

protected $_path

$_requirePath protected property

protected $_requirePath