Development Wiki


From phpBB Development Wiki

Revision as of 00:38, 6 June 2009 by Toonarmy (Talk | contribs)

The cache system provides an API for caching frequently used data, it provides an interface for user code to cache data and an interface for the DBAL to cache query results.


Name Description Parameters Signature
Name Description
Data manipulation
acm::get() Retrieve a cached data object, returns false on failure. $var_name Variable name
function get($var_name)
acm::put() Store a data object in the cache with an optional time-to-live. $var_name Variable name
function put($var_name$var$ttl)
$var Data to store
$ttl Time-to-live (optional)
acm::destroy() Remove a stored object from the cache. $var_name Variable name
function destroy($var_name)
Utility methods
acm::tidy() Perform garbage collection on the cache, removing expired data objects. none
function tidy()
acm::purge() Empty the cache of all data. none
function purge()
acm::save() Commit in memory data to the cache back end. none
function save()
DBAL Interface
acm::sql_load() $query Query to load from cache
function sql_load($query)
acm::sql_save() $query Query to load from cache
function sql_save($query, &$query_result$ttl)
$query_result Result
$ttl Time-to-live
acm::sql_exists() $query_id ID
function sql_exists($query_id)
acm::sql_fetchrow() $query_id ID
function sql_fetchrow($query_id)
acm::sql_fetchfield() $query_id ID
function sql_fetchfield($query_id$field)
acm::sql_rowseek() $rownum Row number to seek to
function sql_rowseek($rownum$query_id)
$query_id ID


Module Description Version File
File Utilises disk drive for data storage >= 2.1 includes/acm/acm_file.php
XCache [1] Storage of data in shared memory >= 3.0.6 includes/acm/acm_xcache.php
APC [2] Storage of data in shared memory >= 3.0.6 includes/acm/acm_apc.php
eAccelerator [3] Storage of data in shared memory >= 3.0.6 includes/acm/acm_eaccelerator.php
Memcache [4] Uses a memcached instance to store data >= 3.0.6 includes/acm/acm_memcache.php


As of 3.0.6-dev the file cache module uses a new improved format for its cache files.


  • expiration := expiration timestamp
  • query := SQL query
  • bytes := number of bytes in data (except global data includes the length of var)
  • var := Variable name
  • data := Cached data

SQL queries:

<?php exit; ?>

Normal data:

<?php exit; ?>

Global data:

<?php exit; ?>

This article is a stub. You can help in improving Olympus Documentation by expanding it.