aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/cache/driver/driver_interface.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb/cache/driver/driver_interface.php')
-rw-r--r--phpBB/phpbb/cache/driver/driver_interface.php45
1 files changed, 37 insertions, 8 deletions
diff --git a/phpBB/phpbb/cache/driver/driver_interface.php b/phpBB/phpbb/cache/driver/driver_interface.php
index 0715a4b934..9ac9ca0c59 100644
--- a/phpBB/phpbb/cache/driver/driver_interface.php
+++ b/phpBB/phpbb/cache/driver/driver_interface.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package acm
-* @copyright (c) 2010 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -11,53 +15,78 @@ namespace phpbb\cache\driver;
/**
* An interface that all cache drivers must implement
-*
-* @package acm
*/
interface driver_interface
{
/**
* Load global cache
+ *
+ * @return mixed False if an error was encountered, otherwise the data type of the cached data
*/
public function load();
/**
* Unload cache object
+ *
+ * @return null
*/
public function unload();
/**
* Save modified objects
+ *
+ * @return null
*/
public function save();
/**
* Tidy cache
+ *
+ * @return null
*/
public function tidy();
/**
* Get saved cache object
+ *
+ * @param string $var_name Cache key
+ * @return mixed False if an error was encountered, otherwise the saved cached object
*/
public function get($var_name);
/**
* Put data into cache
+ *
+ * @param string $var_name Cache key
+ * @param mixed $var Cached data to store
+ * @param int $ttl Time-to-live of cached data
+ * @return null
*/
public function put($var_name, $var, $ttl = 0);
/**
* Purge cache data
+ *
+ * @return null
*/
public function purge();
/**
* Destroy cache data
+ *
+ * @param string $var_name Cache key
+ * @param string $table Table name
+ * @return null
*/
public function destroy($var_name, $table = '');
/**
* Check if a given cache entry exists
+ *
+ * @param string $var_name Cache key
+ *
+ * @return bool True if cache file exists and has not expired.
+ * False otherwise.
*/
public function _exists($var_name);
@@ -79,7 +108,7 @@ interface driver_interface
* result to persistent storage. In other words, there is no need
* to call save() afterwards.
*
- * @param \phpbb\db\driver\driver $db Database connection
+ * @param \phpbb\db\driver\driver_interface $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
@@ -90,7 +119,7 @@ interface driver_interface
* 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);
+ public function sql_save(\phpbb\db\driver\driver_interface $db, $query, $query_result, $ttl);
/**
* Check if result for a given SQL query exists in cache.
@@ -113,7 +142,7 @@ interface driver_interface
* Fetch a field from the current row of a cached database result (database)
*
* @param int $query_id
- * @param $field The name of the column.
+ * @param string $field The name of the column.
* @return string|bool The field of the query result if found in the cache,
* otherwise false.
*/