PHP Class ElggFileCache, Elgg

Inheritance: extends ElggCache
Afficher le fichier Open project: elgg/elgg Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( string $cache_path, integer $max_age, integer $max_size ) Set the Elgg cache.
__destruct ( ) Preform cleanup and invalidates cache upon object destruction
clear ( ) : void Delete all files in the directory of this file cache
delete ( string $key ) : boolean Invalidate a given key.
load ( string $key, integer $offset, integer $limit = null ) : string Load a key
save ( string $key, string $data ) : boolean Save a key

Méthodes protégées

Méthode Description
createFile ( string $filename, string $rw = "rb" ) : mixed Create and return a handle to a file.
sanitizeFilename ( string $key ) : string Create a sanitised filename for the file.

Method Details

__construct() public méthode

Set the Elgg cache.
public __construct ( string $cache_path, integer $max_age, integer $max_size )
$cache_path string The cache path.
$max_age integer Maximum age in seconds, 0 if no limit.
$max_size integer Maximum size of cache in seconds, 0 if no limit.

__destruct() public méthode

Preform cleanup and invalidates cache upon object destruction
public __destruct ( )

clear() public méthode

Delete all files in the directory of this file cache
public clear ( ) : void
Résultat void

createFile() protected méthode

Create and return a handle to a file.
protected createFile ( string $filename, string $rw = "rb" ) : mixed
$filename string Filename to save as
$rw string Write mode
Résultat mixed

delete() public méthode

Invalidate a given key.
public delete ( string $key ) : boolean
$key string Name
Résultat boolean

load() public méthode

Load a key
public load ( string $key, integer $offset, integer $limit = null ) : string
$key string Name
$offset integer Offset
$limit integer Limit
Résultat string

sanitizeFilename() protected méthode

Create a sanitised filename for the file.
protected sanitizeFilename ( string $key ) : string
$key string The filename
Résultat string

save() public méthode

Save a key
public save ( string $key, string $data ) : boolean
$key string Name
$data string Value
Résultat boolean