File
extends AbstractAdapter
in package
File adapter cache class
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- Constructor
- clear() : File
- Clear all stored values from cache
- deleteItem() : File
- Delete a value in cache
- destroy() : File
- Destroy cache resource
- getDir() : string|null
- Get the current cache dir
- getItem() : mixed
- Get an item from cache
- getItemTtl() : int
- Get the time-to-live for an item in cache
- getTtl() : int
- Get the global time-to-live for the cache object
- hasItem() : bool
- Determine if the item exist in cache
- saveItem() : File
- Save an item to cache
- setDir() : File
- Set the current cache dir
- setTtl() : AbstractAdapter
- Set the global time-to-live for the cache adapter
Properties
$dir
Cache dir
protected
string|null
$dir
= null
$ttl
Global time-to-live
protected
int
$ttl
= 0
Methods
__construct()
Constructor
public
__construct(string $dir[, int $ttl = 0 ]) : mixed
Instantiate the cache file object
Parameters
- $dir : string
- $ttl : int = 0
clear()
Clear all stored values from cache
public
clear() : File
Return values
FiledeleteItem()
Delete a value in cache
public
deleteItem(string $id) : File
Parameters
- $id : string
Return values
Filedestroy()
Destroy cache resource
public
destroy() : File
Return values
FilegetDir()
Get the current cache dir
public
getDir() : string|null
Return values
string|nullgetItem()
Get an item from cache
public
getItem(string $id) : mixed
Parameters
- $id : string
getItemTtl()
Get the time-to-live for an item in cache
public
getItemTtl(string $id) : int
Parameters
- $id : string
Return values
intgetTtl()
Get the global time-to-live for the cache object
public
getTtl() : int
Return values
inthasItem()
Determine if the item exist in cache
public
hasItem(string $id) : bool
Parameters
- $id : string
Return values
boolsaveItem()
Save an item to cache
public
saveItem(string $id, mixed $value[, int|null $ttl = null ]) : File
Parameters
- $id : string
- $value : mixed
- $ttl : int|null = null
Return values
FilesetDir()
Set the current cache dir
public
setDir(string $dir) : File
Parameters
- $dir : string
Tags
Return values
FilesetTtl()
Set the global time-to-live for the cache adapter
public
setTtl(int $ttl) : AbstractAdapter
Parameters
- $ttl : int