Class FileStorage (namespace Nette\Caching)
Cache file storage.
Object | --FileStorage
Implements interfaces:
Direct Known Sub-classes:
Public Method Summary | |
---|---|
FileStorage |
__construct
($base)
|
bool |
clean
($conds)
Removes items from the cache by conditions & garbage collector.
|
mixed|NULL |
read
(string $key)
Read from cache.
|
bool |
remove
(string $key)
Removes item from the cache.
|
bool |
write
(string $key, mixed $data, $dp)
Writes item into the cache.
|
Protected Method Summary | |
---|---|
protected string |
getCacheFile
(string $key)
Returns file name.
|
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 64 additional cache structure |
string | HANDLE |
'handle' |
line 65 additional cache structure |
string | META_CONSTS |
'consts' |
line 60 internal cache file structure |
string | META_DELTA |
'delta' |
line 56 internal cache file structure |
string | META_EXPIRE |
'expire' |
line 55 internal cache file structure |
string | META_FILES |
'df' |
line 57 internal cache file structure |
int | META_HEADER_LEN |
28 |
line 50 internal cache file structure |
string | META_ITEMS |
'di' |
line 58 internal cache file structure |
string | META_PRIORITY |
'priority' |
line 54 internal cache file structure |
string | META_SERIALIZED |
'serialized' |
line 53 internal cache file structure |
string | META_TAGS |
'tags' |
line 59 internal cache file structure |
string | META_TIME |
'time' |
line 52 internal cache file structure |
Variable Summary | ||||
---|---|---|---|---|
protected string | $base |
|
line 73 |
|
static float | $gcProbability | 0.001 |
line 70 probability that the clean() routine is started |
Method Details | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
line 77 __constructpublic FileStorage __construct ($base)
|
||||||||||||||||||
line 285 cleanpublic bool clean ($conds) Removes items from the cache by conditions & garbage collector. Implementation of:
|
||||||||||||||||||
line 386 getCacheFileprotected string getCacheFile (string $key) Returns file name. Overridden in child classes as:
|
||||||||||||||||||
line 98 readpublic mixed|NULL read (string $key) Read from cache. Implementation of:
|
||||||||||||||||||
line 367 readDataprotected mixed readData (array $meta) Reads cache data from disk and closes cache file handle. Overridden in child classes as:
|
||||||||||||||||||
line 336 readMetaprotected array|NULL readMeta (string $file, int $lock) Reads cache data from disk.
|
||||||||||||||||||
line 266 removepublic bool remove (string $key) Removes item from the cache. Implementation of:
|
||||||||||||||||||
line 172 writepublic bool write (string $key, mixed $data, $dp) Writes item into the cache. Implementation of:
|