libraries/drivers/Cache/Sqlite – Kohana API 2.3 Documentation

system/libraries/drivers/Cache/Sqlite.php

Class: Cache_Sqlite_Driver

class Cache_Sqlite_Driver implements Cache_Driver

SQLite-based Cache driver.


Methods

Cache_Sqlite_Driver :: log_error

protected static function log_error

Logs an SQLite error.

Parameters:

code

Cache_Sqlite_Driver -> __construct

public function __construct

Tests that the storage location is a directory and is writable.

Parameters:

filename

Cache_Sqlite_Driver -> exists

public function exists

Checks if a cache id is already set.

Parameters:

string id
cache id

Return: boolean


Cache_Sqlite_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_Sqlite_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_Sqlite_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_Sqlite_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"
bool tag
(FALSE) use tags

Return: bool


Cache_Sqlite_Driver -> delete_expired

public function delete_expired

Deletes all cache files that are older than the current time.