system/libraries/drivers/Cache/File.php
Class: Cache_File_Driver
class Cache_File_Driver implements Cache_Driver
File-based Cache driver.
Methods
- Cache_File_Driver -> __construct
- Cache_File_Driver -> exists
- Cache_File_Driver -> set
- Cache_File_Driver -> find
- Cache_File_Driver -> get
- Cache_File_Driver -> delete
- Cache_File_Driver -> delete_expired
- Cache_File_Driver -> expired
Cache_File_Driver -> __construct
public function __construct
Tests that the storage location is a directory and is writable.
Parameters:
- directory
Cache_File_Driver -> exists
public function exists
Finds an array of files matching the given id or tag.
Parameters:
- string id
- cache id or tag
- bool tag
- (FALSE) search for tags
Return:
- array of filenames matching the id or tag
- void if no matching files are found
Cache_File_Driver -> set
public function set
Sets a cache item to the given data, tags, and lifetime.
Parameters:
- string id
- cache id to set
- string data
- data in the cache
- array tags
- cache tags
- integer lifetime
- lifetime
Return: bool
Cache_File_Driver -> find
public function find
Finds an array of ids for a given tag.
Parameters:
- string tag
- tag name
Return: array of ids that match the tag
Cache_File_Driver -> get
public function get
Fetches a cache item. This will delete the item if it is expired or if the hash does not match the stored hash.
Parameters:
- string id
- cache id
Return: mixed|NULL
Cache_File_Driver -> delete
public function delete
Deletes a cache item by id or tag
Parameters:
- string id
- cache id or tag, or TRUE for "all items"
- boolean tag
- (FALSE) use tags
Return: boolean
Cache_File_Driver -> delete_expired
public function delete_expired
Deletes all cache files that are older than the current time.
Return: void
Cache_File_Driver -> expired
protected function expired
Check if a cache file has expired by filename.
Parameters:
- string file
- filename
Return: bool