aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/cache/driver/driver_interface.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2013-10-10 23:39:09 +0200
committerAndreas Fischer <bantu@phpbb.com>2013-10-10 23:39:09 +0200
commit353ac33d5cea1752047779eb8c70c7ce3a64b6c8 (patch)
tree76e08c4e16c68256700506b7111c3cbb547dc877 /phpBB/phpbb/cache/driver/driver_interface.php
parent0228424983e35badc779923a1f0398fc3ab7c8b2 (diff)
parentb59131f558a6d0fe4c836e2658152c8698f0cd22 (diff)
downloadforums-353ac33d5cea1752047779eb8c70c7ce3a64b6c8.tar
forums-353ac33d5cea1752047779eb8c70c7ce3a64b6c8.tar.gz
forums-353ac33d5cea1752047779eb8c70c7ce3a64b6c8.tar.bz2
forums-353ac33d5cea1752047779eb8c70c7ce3a64b6c8.tar.xz
forums-353ac33d5cea1752047779eb8c70c7ce3a64b6c8.zip
Merge remote-tracking branch 'phpbb/develop' into ticket/11621
* phpbb/develop: (542 commits) [ticket/11901] Pass empty string as relative_url for non-local magic URL. [ticket/11898] Correct adm_relative_path created by installer [ticket/11898] Correct admin S_LOGIN_ACTION [ticket/11892] Fix undefined variables: to_forum_id & to_topic_id [ticket/11890] Fix untranslated string when deleting posts through MCP. [ticket/11895] Fix undefined $forum_id [ticket/10383] Update the results without the overlay popup. [ticket/10383] Make the content transitions smoother. [ticket/10383] AJAXify poll voting [ticket/11888] Update default search backend in namespaces migration [ticket/11739] Rename “Remember Me” login keys module [ticket/11893] Remove unnecessary <fieldset> causing a large font size [ticket/11894] Fix typo in "Delete post" option [ticket/11888] Use \phpbb\search\fulltext_native as search backend config [ticket/11608] Mark failed test as incomplete for mysql search backend [ticket/11608] Update search backend class names to namespaces [ticket/11608] Move markIncomplete to search backends test [ticket/11608] Rename base search test class file [ticket/11608] Remove suffix test from base class [ticket/11608] Mark postgres search not found test as incomplete ...
Diffstat (limited to 'phpBB/phpbb/cache/driver/driver_interface.php')
-rw-r--r--phpBB/phpbb/cache/driver/driver_interface.php146
1 files changed, 146 insertions, 0 deletions
diff --git a/phpBB/phpbb/cache/driver/driver_interface.php b/phpBB/phpbb/cache/driver/driver_interface.php
new file mode 100644
index 0000000000..34c60b5935
--- /dev/null
+++ b/phpBB/phpbb/cache/driver/driver_interface.php
@@ -0,0 +1,146 @@
+<?php
+/**
+*
+* @package acm
+* @copyright (c) 2010 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+namespace phpbb\cache\driver;
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+/**
+* An interface that all cache drivers must implement
+*
+* @package acm
+*/
+interface 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 exists
+ */
+ public function _exists($var_name);
+
+ /**
+ * Load result of an SQL query from cache.
+ *
+ * @param string $query SQL query
+ *
+ * @return int|bool Query ID (integer) if cache contains a rowset
+ * for the specified query.
+ * False otherwise.
+ */
+ public function sql_load($query);
+
+ /**
+ * 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.
+ *
+ * @param \phpbb\db\driver\driver $db Database connection
+ * @param string $query SQL query, should be used for generating storage key
+ * @param mixed $query_result The result from \dbal::sql_query, to be passed to
+ * \dbal::sql_fetchrow to get all rows and store them
+ * in cache.
+ * @param int $ttl Time to live, after this timeout the query should
+ * expire from the cache.
+ * @return int|mixed If storing in cache succeeded, an integer $query_id
+ * representing the query should be returned. Otherwise
+ * the original $query_result should be returned.
+ */
+ public function sql_save(\phpbb\db\driver\driver $db, $query, $query_result, $ttl);
+
+ /**
+ * Check if result for a given SQL query exists in cache.
+ *
+ * @param int $query_id
+ * @return bool
+ */
+ public function sql_exists($query_id);
+
+ /**
+ * Fetch row from cache (database)
+ *
+ * @param int $query_id
+ * @return array|bool The query result if found in the cache, otherwise
+ * false.
+ */
+ public function sql_fetchrow($query_id);
+
+ /**
+ * Fetch a field from the current row of a cached database result (database)
+ *
+ * @param int $query_id
+ * @param $field The name of the column.
+ * @return string|bool The field of the query result if found in the cache,
+ * otherwise false.
+ */
+ public function sql_fetchfield($query_id, $field);
+
+ /**
+ * Seek a specific row in an a cached database result (database)
+ *
+ * @param int $rownum Row to seek to.
+ * @param int $query_id
+ * @return bool
+ */
+ public function sql_rowseek($rownum, $query_id);
+
+ /**
+ * Free memory used for a cached database result (database)
+ *
+ * @param int $query_id
+ * @return bool
+ */
+ public function sql_freeresult($query_id);
+}