Class FileStorage (namespace Nette\Caching)


Cache file storage.

Object
   |
   --FileStorage

Implements interfaces:

Direct Known Sub-classes:

Copyright: Copyright (c) 2004, 2010 David Grudl
Located: in /Caching/FileStorage.php (line 21)
Public Method Summary
void
clean ($conds)
Removes items from the cache by conditions & garbage collector.
FileStorage
__construct ($dir)
mixed|NULL
read (string $key)
Read from cache.
void
remove (string $key)
Removes item from the cache.
void
write (string $key, mixed $data, $dp)
Writes item into the cache.
Protected Method Summary
protected string
getCacheFile (string $key)
Returns file name.
protected resource
getDb ()
Returns SQLite resource.
protected mixed
readData (array $meta)
Reads cache data from disk and closes cache file handle.
protected array|NULL
readMeta (string $file, int $lock)
Reads cache data from disk.
Methods Inherited From Object
extensionMethod(), getClass(), getReflection(), __call(), __callStatic(), __get(), __isset(), __set(), __unset()
Constant Summary
string FILE 'file'

line 46

additional cache structure
string HANDLE 'handle'

line 47

additional cache structure
Variable Summary
static float $gcProbability 0.001

line 52

probability that the clean() routine is started
static bool $useDirectories

line 55


Method Details

line 273

clean

public void clean ($conds)

Removes items from the cache by conditions & garbage collector.

Implementation of:

Input
$conds conditions
Output
void  

line 396

getCacheFile

protected string getCacheFile (string $key)

Returns file name.

Overridden in child classes as:

Input
string $key
Output
string  

line 438

getDb

protected resource getDb ()

Returns SQLite resource.

Output
resource  

line 68

__construct

public FileStorage __construct ($dir)

Input
$dir
Output
FileStorage  

line 103

read

public mixed|NULL read (string $key)

Read from cache.

Implementation of:

Input
string $key key
Output
mixed|NULL  

line 377

readData

protected mixed readData (array $meta)

Reads cache data from disk and closes cache file handle.

Overridden in child classes as:

Input
array $meta
Output
mixed  

line 346

readMeta

protected array|NULL readMeta (string $file, int $lock)

Reads cache data from disk.

Input
string $file file path
int $lock lock mode
Output
array|NULL  

line 261

remove

public void remove (string $key)

Removes item from the cache.

Implementation of:

Input
string $key key
Output
void  

line 161

write

public void write (string $key, mixed $data, $dp)

Writes item into the cache.

Implementation of:

Input
string $key key
mixed $data data
$dp dependencies
Output
void