aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/cache/driver/interface.php
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2010-11-03 18:35:31 +0100
committerIgor Wiedler <igor@wiedler.ch>2011-01-09 23:49:35 +0100
commit9329b16ab13f3a4caf107df358c3c58bda2dcd8a (patch)
tree0b5faa7111c792565062c93b1c1a44eda50d4664 /phpBB/includes/cache/driver/interface.php
parent36e95f939db9b88b8519d956120d161102184ccb (diff)
downloadforums-9329b16ab13f3a4caf107df358c3c58bda2dcd8a.tar
forums-9329b16ab13f3a4caf107df358c3c58bda2dcd8a.tar.gz
forums-9329b16ab13f3a4caf107df358c3c58bda2dcd8a.tar.bz2
forums-9329b16ab13f3a4caf107df358c3c58bda2dcd8a.tar.xz
forums-9329b16ab13f3a4caf107df358c3c58bda2dcd8a.zip
[task/acm-refactor] Refactor the ACM classes to have a common interface.
They are now refered to as cache drivers rather than ACM classes. The additional utility functions from the original cache class have been moved to the cache_service. The class loader is now instantiated without a cache instance and passed one as soon as it is constructed to allow autoloading the cache classes. PHPBB3-9983
Diffstat (limited to 'phpBB/includes/cache/driver/interface.php')
-rw-r--r--phpBB/includes/cache/driver/interface.php104
1 files changed, 104 insertions, 0 deletions
diff --git a/phpBB/includes/cache/driver/interface.php b/phpBB/includes/cache/driver/interface.php
new file mode 100644
index 0000000000..91d364abf6
--- /dev/null
+++ b/phpBB/includes/cache/driver/interface.php
@@ -0,0 +1,104 @@
+<?php
+/**
+*
+* @package acm
+* @copyright (c) 2010 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+/**
+* An interface that all cache drivers must implement
+*
+* @package acm
+*/
+interface phpbb_cache_driver_interface
+{
+ /**
+ * Load global cache
+ */
+ public function load();
+
+ /**
+ * Unload cache object
+ */
+ public function unload();
+
+ /**
+ * Save modified objects
+ */
+ public function save();
+
+ /**
+ * Tidy cache
+ */
+ public function tidy();
+
+ /**
+ * Get saved cache object
+ */
+ public function get($var_name);
+
+ /**
+ * Put data into cache
+ */
+ public function put($var_name, $var, $ttl = 0);
+
+ /**
+ * Purge cache data
+ */
+ public function purge();
+
+ /**
+ * Destroy cache data
+ */
+ public function destroy($var_name, $table = '');
+
+ /**
+ * Check if a given cache entry exist
+ */
+ public function _exists($var_name);
+
+ /**
+ * Load cached sql query
+ */
+ public function sql_load($query);
+
+ /**
+ * Save sql query
+ */
+ public function sql_save($query, &$query_result, $ttl);
+
+ /**
+ * Ceck if a given sql query exist in cache
+ */
+ public function sql_exists($query_id);
+
+ /**
+ * Fetch row from cache (database)
+ */
+ public function sql_fetchrow($query_id);
+
+ /**
+ * Fetch a field from the current row of a cached database result (database)
+ */
+ public function sql_fetchfield($query_id, $field);
+
+ /**
+ * Seek a specific row in an a cached database result (database)
+ */
+ public function sql_rowseek($rownum, $query_id);
+
+ /**
+ * Free memory used for a cached database result (database)
+ */
+ public function sql_freeresult($query_id);
+}