class file extends base
ACM File Based Caching
Properties
$vars | ||
$is_modified | ||
$sql_rowset | ||
$sql_row_pointer | ||
$cache_dir | ||
$var_expires |
Methods
null |
purge()
Purge cache data |
|
null |
unload()
Unload cache object |
|
int|bool |
sql_load(string $query)
Load result of an SQL query from cache. |
from base |
bool |
sql_exists(int $query_id)
Check if result for a given SQL query exists in cache. |
from base |
array|bool |
sql_fetchrow(int $query_id)
Fetch row from cache (database) |
from base |
string|bool |
sql_fetchfield(int $query_id, string $field)
Fetch a field from the current row of a cached database result (database) |
from base |
bool |
sql_rowseek(int $rownum, int $query_id)
Seek a specific row in an a cached database result (database) |
from base |
bool |
sql_freeresult(int $query_id)
Free memory used for a cached database result (database) |
from base |
bool |
remove_file(string $filename, bool $check = false)
Removes/unlinks file |
from base |
__construct(string $cache_dir = null)
Set cache path |
||
mixed |
load()
Load global cache |
|
null |
save()
Save modified objects |
|
null |
tidy()
Tidy cache |
|
mixed |
get(string $var_name)
Get saved cache object |
|
null |
put(string $var_name, mixed $var, int $ttl = 31536000)
Put data into cache |
|
null |
destroy(string $var_name, string $table = '')
Destroy cache data |
|
bool |
_exists(string $var_name)
Check if a given cache entry exists |
|
int|mixed |
sql_save(driver_interface $db, string $query, mixed $query_result, int $ttl)
Save result of an SQL query in cache. |
|
mixed |
_read(string $filename)
Read cached data from a specified file |
|
bool |
_write(string $filename, mixed $data = null, int $expires, string $query = '')
Write cache data to a specified file |
Details
at line 195
public null
purge()
Purge cache data
at line 57
public null
unload()
Unload cache object
in base at line 96
public int|bool
sql_load(string $query)
Load result of an SQL query from cache.
in base at line 116
public bool
sql_exists(int $query_id)
Check if result for a given SQL query exists in cache.
in base at line 124
public array|bool
sql_fetchrow(int $query_id)
Fetch row from cache (database)
in base at line 137
public string|bool
sql_fetchfield(int $query_id, string $field)
Fetch a field from the current row of a cached database result (database)
in base at line 150
public bool
sql_rowseek(int $rownum, int $query_id)
Seek a specific row in an a cached database result (database)
in base at line 164
public bool
sql_freeresult(int $query_id)
Free memory used for a cached database result (database)
in base at line 184
public bool
remove_file(string $filename, bool $check = false)
Removes/unlinks file
at line 33
public
__construct(string $cache_dir = null)
Set cache path
at line 49
public mixed
load()
Load global cache
at line 67
public null
save()
Save modified objects
at line 96
public null
tidy()
Tidy cache
at line 158
public mixed
get(string $var_name)
Get saved cache object
at line 178
public null
put(string $var_name, mixed $var, int $ttl = 31536000)
Put data into cache
at line 204
public null
destroy(string $var_name, string $table = '')
Destroy cache data
at line 283
public bool
_exists(string $var_name)
Check if a given cache entry exists
at line 310
public int|mixed
sql_save(driver_interface $db, string $query, mixed $query_result, int $ttl)
Save result of an SQL query in cache.
In persistent cache stores, this function stores the query result to persistent storage. In other words, there is no need to call save() afterwards.
at line 340
public mixed
_read(string $filename)
Read cached data from a specified file
at line 523
public bool
_write(string $filename, mixed $data = null, int $expires, string $query = '')
Write cache data to a specified file
'data_global' is a special case and the generated format is different for this file:
(expiration)
(length of var and serialised data)
(var)
(serialised data)
... (repeat)
The other files have a similar format:
(expiration)
(query) [SQL files only]
(length of serialised data)
(serialised data)