aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/cache
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb/cache')
-rw-r--r--phpBB/phpbb/cache/driver/apc.php14
-rw-r--r--phpBB/phpbb/cache/driver/base.php10
-rw-r--r--phpBB/phpbb/cache/driver/driver_interface.php (renamed from phpBB/phpbb/cache/driver/interface.php)45
-rw-r--r--phpBB/phpbb/cache/driver/eaccelerator.php20
-rw-r--r--phpBB/phpbb/cache/driver/file.php56
-rw-r--r--phpBB/phpbb/cache/driver/memcache.php20
-rw-r--r--phpBB/phpbb/cache/driver/memory.php46
-rw-r--r--phpBB/phpbb/cache/driver/null.php42
-rw-r--r--phpBB/phpbb/cache/driver/redis.php25
-rw-r--r--phpBB/phpbb/cache/driver/wincache.php14
-rw-r--r--phpBB/phpbb/cache/driver/xcache.php14
-rw-r--r--phpBB/phpbb/cache/service.php30
12 files changed, 140 insertions, 196 deletions
diff --git a/phpBB/phpbb/cache/driver/apc.php b/phpBB/phpbb/cache/driver/apc.php
index 0516b669c8..77b7b11181 100644
--- a/phpBB/phpbb/cache/driver/apc.php
+++ b/phpBB/phpbb/cache/driver/apc.php
@@ -7,26 +7,18 @@
*
*/
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
+namespace phpbb\cache\driver;
/**
* ACM for APC
* @package acm
*/
-class phpbb_cache_driver_apc extends phpbb_cache_driver_memory
+class apc extends \phpbb\cache\driver\memory
{
var $extension = 'apc';
/**
- * Purge cache data
- *
- * @return null
+ * {@inheritDoc}
*/
function purge()
{
diff --git a/phpBB/phpbb/cache/driver/base.php b/phpBB/phpbb/cache/driver/base.php
index 32e04f813a..feaca25a5b 100644
--- a/phpBB/phpbb/cache/driver/base.php
+++ b/phpBB/phpbb/cache/driver/base.php
@@ -7,17 +7,11 @@
*
*/
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
+namespace phpbb\cache\driver;
/**
* @package acm
*/
-abstract class phpbb_cache_driver_base implements phpbb_cache_driver_interface
+abstract class base implements \phpbb\cache\driver\driver_interface
{
}
diff --git a/phpBB/phpbb/cache/driver/interface.php b/phpBB/phpbb/cache/driver/driver_interface.php
index 53f684d1c8..8929647411 100644
--- a/phpBB/phpbb/cache/driver/interface.php
+++ b/phpBB/phpbb/cache/driver/driver_interface.php
@@ -7,63 +7,84 @@
*
*/
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
+namespace phpbb\cache\driver;
/**
* An interface that all cache drivers must implement
*
* @package acm
*/
-interface phpbb_cache_driver_interface
+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);
@@ -85,10 +106,10 @@ interface phpbb_cache_driver_interface
* result to persistent storage. In other words, there is no need
* to call save() afterwards.
*
- * @param phpbb_db_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
+ * @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.
@@ -96,7 +117,7 @@ interface phpbb_cache_driver_interface
* representing the query should be returned. Otherwise
* the original $query_result should be returned.
*/
- public function sql_save(phpbb_db_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.
diff --git a/phpBB/phpbb/cache/driver/eaccelerator.php b/phpBB/phpbb/cache/driver/eaccelerator.php
index 257b90c76e..d1ad69ef6d 100644
--- a/phpBB/phpbb/cache/driver/eaccelerator.php
+++ b/phpBB/phpbb/cache/driver/eaccelerator.php
@@ -7,20 +7,14 @@
*
*/
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
+namespace phpbb\cache\driver;
/**
* ACM for eAccelerator
* @package acm
* @todo Missing locks from destroy() talk with David
*/
-class phpbb_cache_driver_eaccelerator extends phpbb_cache_driver_memory
+class eaccelerator extends \phpbb\cache\driver\memory
{
var $extension = 'eaccelerator';
var $function = 'eaccelerator_get';
@@ -28,9 +22,7 @@ class phpbb_cache_driver_eaccelerator extends phpbb_cache_driver_memory
var $serialize_header = '#phpbb-serialized#';
/**
- * Purge cache data
- *
- * @return null
+ * {@inheritDoc}
*/
function purge()
{
@@ -45,10 +37,8 @@ class phpbb_cache_driver_eaccelerator extends phpbb_cache_driver_memory
}
/**
- * Perform cache garbage collection
- *
- * @return null
- */
+ * {@inheritDoc}
+ */
function tidy()
{
eaccelerator_gc();
diff --git a/phpBB/phpbb/cache/driver/file.php b/phpBB/phpbb/cache/driver/file.php
index 944dfd6541..286ba328c3 100644
--- a/phpBB/phpbb/cache/driver/file.php
+++ b/phpBB/phpbb/cache/driver/file.php
@@ -7,19 +7,13 @@
*
*/
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
+namespace phpbb\cache\driver;
/**
* ACM File Based Caching
* @package acm
*/
-class phpbb_cache_driver_file extends phpbb_cache_driver_base
+class file extends \phpbb\cache\driver\base
{
var $vars = array();
var $var_expires = array();
@@ -39,7 +33,7 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base
}
/**
- * Load global cache
+ * {@inheritDoc}
*/
function load()
{
@@ -47,7 +41,7 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base
}
/**
- * Unload cache object
+ * {@inheritDoc}
*/
function unload()
{
@@ -64,7 +58,7 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base
}
/**
- * Save modified objects
+ * {@inheritDoc}
*/
function save()
{
@@ -99,7 +93,7 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base
}
/**
- * Tidy cache
+ * {@inheritDoc}
*/
function tidy()
{
@@ -161,7 +155,7 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base
}
/**
- * Get saved cache object
+ * {@inheritDoc}
*/
function get($var_name)
{
@@ -183,7 +177,7 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base
}
/**
- * Put data into cache
+ * {@inheritDoc}
*/
function put($var_name, $var, $ttl = 31536000)
{
@@ -200,14 +194,14 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base
}
/**
- * Purge cache data
+ * {@inheritDoc}
*/
function purge()
{
// Purge all phpbb cache files
- try
+ try
{
- $iterator = new DirectoryIterator($this->cache_dir);
+ $iterator = new \DirectoryIterator($this->cache_dir);
}
catch (Exception $e)
{
@@ -256,9 +250,9 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base
*/
protected function remove_dir($dir)
{
- try
+ try
{
- $iterator = new DirectoryIterator($dir);
+ $iterator = new \DirectoryIterator($dir);
}
catch (Exception $e)
{
@@ -286,7 +280,7 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base
}
/**
- * Destroy cache data
+ * {@inheritDoc}
*/
function destroy($var_name, $table = '')
{
@@ -365,7 +359,7 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base
}
/**
- * Check if a given cache entry exist
+ * {@inheritDoc}
*/
function _exists($var_name)
{
@@ -391,7 +385,7 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base
}
/**
- * Load cached sql query
+ * {@inheritDoc}
*/
function sql_load($query)
{
@@ -413,7 +407,7 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base
/**
* {@inheritDoc}
*/
- function sql_save(phpbb_db_driver $db, $query, $query_result, $ttl)
+ function sql_save(\phpbb\db\driver\driver_interface $db, $query, $query_result, $ttl)
{
// Remove extra spaces and tabs
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
@@ -437,7 +431,7 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base
}
/**
- * Ceck if a given sql query exist in cache
+ * {@inheritDoc}
*/
function sql_exists($query_id)
{
@@ -445,7 +439,7 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base
}
/**
- * Fetch row from cache (database)
+ * {@inheritDoc}
*/
function sql_fetchrow($query_id)
{
@@ -458,7 +452,7 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base
}
/**
- * Fetch a field from the current row of a cached database result (database)
+ * {@inheritDoc}
*/
function sql_fetchfield($query_id, $field)
{
@@ -471,7 +465,7 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base
}
/**
- * Seek a specific row in an a cached database result (database)
+ * {@inheritDoc}
*/
function sql_rowseek($rownum, $query_id)
{
@@ -485,7 +479,7 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base
}
/**
- * Free memory used for a cached database result (database)
+ * {@inheritDoc}
*/
function sql_freeresult($query_id)
{
@@ -695,7 +689,7 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base
$file = "{$this->cache_dir}$filename.$phpEx";
- $lock = new phpbb_lock_flock($file);
+ $lock = new \phpbb\lock\flock($file);
$lock->acquire();
if ($handle = @fopen($file, 'wb'))
@@ -764,6 +758,10 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base
/**
* Removes/unlinks file
+ *
+ * @param string $filename Filename to remove
+ * @param bool $check Check file permissions
+ * @return bool True if the file was successfully removed, otherwise false
*/
function remove_file($filename, $check = false)
{
diff --git a/phpBB/phpbb/cache/driver/memcache.php b/phpBB/phpbb/cache/driver/memcache.php
index 3fd16b23b0..eb3fced973 100644
--- a/phpBB/phpbb/cache/driver/memcache.php
+++ b/phpBB/phpbb/cache/driver/memcache.php
@@ -7,13 +7,7 @@
*
*/
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
+namespace phpbb\cache\driver;
if (!defined('PHPBB_ACM_MEMCACHE_PORT'))
{
@@ -40,7 +34,7 @@ if (!defined('PHPBB_ACM_MEMCACHE'))
* ACM for Memcached
* @package acm
*/
-class phpbb_cache_driver_memcache extends phpbb_cache_driver_memory
+class memcache extends \phpbb\cache\driver\memory
{
var $extension = 'memcache';
@@ -52,7 +46,7 @@ class phpbb_cache_driver_memcache extends phpbb_cache_driver_memory
// Call the parent constructor
parent::__construct();
- $this->memcache = new Memcache;
+ $this->memcache = new \Memcache;
foreach(explode(',', PHPBB_ACM_MEMCACHE) as $u)
{
$parts = explode('/', $u);
@@ -62,9 +56,7 @@ class phpbb_cache_driver_memcache extends phpbb_cache_driver_memory
}
/**
- * Unload the cache resources
- *
- * @return null
+ * {@inheritDoc}
*/
function unload()
{
@@ -74,9 +66,7 @@ class phpbb_cache_driver_memcache extends phpbb_cache_driver_memory
}
/**
- * Purge cache data
- *
- * @return null
+ * {@inheritDoc}
*/
function purge()
{
diff --git a/phpBB/phpbb/cache/driver/memory.php b/phpBB/phpbb/cache/driver/memory.php
index f77a1df316..d5404455d1 100644
--- a/phpBB/phpbb/cache/driver/memory.php
+++ b/phpBB/phpbb/cache/driver/memory.php
@@ -7,19 +7,13 @@
*
*/
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
+namespace phpbb\cache\driver;
/**
* ACM Abstract Memory Class
* @package acm
*/
-abstract class phpbb_cache_driver_memory extends phpbb_cache_driver_base
+abstract class memory extends \phpbb\cache\driver\base
{
var $key_prefix;
@@ -56,7 +50,7 @@ abstract class phpbb_cache_driver_memory extends phpbb_cache_driver_base
}
/**
- * Load global cache
+ * {@inheritDoc}
*/
function load()
{
@@ -72,7 +66,7 @@ abstract class phpbb_cache_driver_memory extends phpbb_cache_driver_base
}
/**
- * Unload cache object
+ * {@inheritDoc}
*/
function unload()
{
@@ -87,7 +81,7 @@ abstract class phpbb_cache_driver_memory extends phpbb_cache_driver_base
}
/**
- * Save modified objects
+ * {@inheritDoc}
*/
function save()
{
@@ -102,7 +96,7 @@ abstract class phpbb_cache_driver_memory extends phpbb_cache_driver_base
}
/**
- * Tidy cache
+ * {@inheritDoc}
*/
function tidy()
{
@@ -112,7 +106,7 @@ abstract class phpbb_cache_driver_memory extends phpbb_cache_driver_base
}
/**
- * Get saved cache object
+ * {@inheritDoc}
*/
function get($var_name)
{
@@ -132,7 +126,7 @@ abstract class phpbb_cache_driver_memory extends phpbb_cache_driver_base
}
/**
- * Put data into cache
+ * {@inheritDoc}
*/
function put($var_name, $var, $ttl = 2592000)
{
@@ -148,7 +142,7 @@ abstract class phpbb_cache_driver_memory extends phpbb_cache_driver_base
}
/**
- * Purge cache data
+ * {@inheritDoc}
*/
function purge()
{
@@ -189,7 +183,7 @@ abstract class phpbb_cache_driver_memory extends phpbb_cache_driver_base
/**
- * Destroy cache data
+ * {@inheritDoc}
*/
function destroy($var_name, $table = '')
{
@@ -243,7 +237,7 @@ abstract class phpbb_cache_driver_memory extends phpbb_cache_driver_base
}
/**
- * Check if a given cache entry exist
+ * {@inheritDoc}
*/
function _exists($var_name)
{
@@ -263,7 +257,7 @@ abstract class phpbb_cache_driver_memory extends phpbb_cache_driver_base
}
/**
- * Load cached sql query
+ * {@inheritDoc}
*/
function sql_load($query)
{
@@ -285,7 +279,7 @@ abstract class phpbb_cache_driver_memory extends phpbb_cache_driver_base
/**
* {@inheritDoc}
*/
- function sql_save(phpbb_db_driver $db, $query, $query_result, $ttl)
+ function sql_save(\phpbb\db\driver\driver_interface $db, $query, $query_result, $ttl)
{
// Remove extra spaces and tabs
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
@@ -341,7 +335,7 @@ abstract class phpbb_cache_driver_memory extends phpbb_cache_driver_base
}
/**
- * Ceck if a given sql query exist in cache
+ * {@inheritDoc}
*/
function sql_exists($query_id)
{
@@ -349,7 +343,7 @@ abstract class phpbb_cache_driver_memory extends phpbb_cache_driver_base
}
/**
- * Fetch row from cache (database)
+ * {@inheritDoc}
*/
function sql_fetchrow($query_id)
{
@@ -362,7 +356,7 @@ abstract class phpbb_cache_driver_memory extends phpbb_cache_driver_base
}
/**
- * Fetch a field from the current row of a cached database result (database)
+ * {@inheritDoc}
*/
function sql_fetchfield($query_id, $field)
{
@@ -375,7 +369,7 @@ abstract class phpbb_cache_driver_memory extends phpbb_cache_driver_base
}
/**
- * Seek a specific row in an a cached database result (database)
+ * {@inheritDoc}
*/
function sql_rowseek($rownum, $query_id)
{
@@ -389,7 +383,7 @@ abstract class phpbb_cache_driver_memory extends phpbb_cache_driver_base
}
/**
- * Free memory used for a cached database result (database)
+ * {@inheritDoc}
*/
function sql_freeresult($query_id)
{
@@ -406,6 +400,10 @@ abstract class phpbb_cache_driver_memory extends phpbb_cache_driver_base
/**
* Removes/unlinks file
+ *
+ * @param string $filename Filename to remove
+ * @param bool $check Check file permissions
+ * @return bool True if the file was successfully removed, otherwise false
*/
function remove_file($filename, $check = false)
{
diff --git a/phpBB/phpbb/cache/driver/null.php b/phpBB/phpbb/cache/driver/null.php
index 2fadc27ba3..99cfe454e0 100644
--- a/phpBB/phpbb/cache/driver/null.php
+++ b/phpBB/phpbb/cache/driver/null.php
@@ -7,19 +7,13 @@
*
*/
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
+namespace phpbb\cache\driver;
/**
* ACM Null Caching
* @package acm
*/
-class phpbb_cache_driver_null extends phpbb_cache_driver_base
+class null extends \phpbb\cache\driver\base
{
/**
* Set cache path
@@ -29,7 +23,7 @@ class phpbb_cache_driver_null extends phpbb_cache_driver_base
}
/**
- * Load global cache
+ * {@inheritDoc}
*/
function load()
{
@@ -37,21 +31,21 @@ class phpbb_cache_driver_null extends phpbb_cache_driver_base
}
/**
- * Unload cache object
+ * {@inheritDoc}
*/
function unload()
{
}
/**
- * Save modified objects
+ * {@inheritDoc}
*/
function save()
{
}
/**
- * Tidy cache
+ * {@inheritDoc}
*/
function tidy()
{
@@ -60,7 +54,7 @@ class phpbb_cache_driver_null extends phpbb_cache_driver_base
}
/**
- * Get saved cache object
+ * {@inheritDoc}
*/
function get($var_name)
{
@@ -68,28 +62,28 @@ class phpbb_cache_driver_null extends phpbb_cache_driver_base
}
/**
- * Put data into cache
+ * {@inheritDoc}
*/
function put($var_name, $var, $ttl = 0)
{
}
/**
- * Purge cache data
+ * {@inheritDoc}
*/
function purge()
{
}
/**
- * Destroy cache data
+ * {@inheritDoc}
*/
function destroy($var_name, $table = '')
{
}
/**
- * Check if a given cache entry exist
+ * {@inheritDoc}
*/
function _exists($var_name)
{
@@ -97,7 +91,7 @@ class phpbb_cache_driver_null extends phpbb_cache_driver_base
}
/**
- * Load cached sql query
+ * {@inheritDoc}
*/
function sql_load($query)
{
@@ -107,13 +101,13 @@ class phpbb_cache_driver_null extends phpbb_cache_driver_base
/**
* {@inheritDoc}
*/
- function sql_save(phpbb_db_driver $db, $query, $query_result, $ttl)
+ function sql_save(\phpbb\db\driver\driver_interface $db, $query, $query_result, $ttl)
{
return $query_result;
}
/**
- * Ceck if a given sql query exist in cache
+ * {@inheritDoc}
*/
function sql_exists($query_id)
{
@@ -121,7 +115,7 @@ class phpbb_cache_driver_null extends phpbb_cache_driver_base
}
/**
- * Fetch row from cache (database)
+ * {@inheritDoc}
*/
function sql_fetchrow($query_id)
{
@@ -129,7 +123,7 @@ class phpbb_cache_driver_null extends phpbb_cache_driver_base
}
/**
- * Fetch a field from the current row of a cached database result (database)
+ * {@inheritDoc}
*/
function sql_fetchfield($query_id, $field)
{
@@ -137,7 +131,7 @@ class phpbb_cache_driver_null extends phpbb_cache_driver_base
}
/**
- * Seek a specific row in an a cached database result (database)
+ * {@inheritDoc}
*/
function sql_rowseek($rownum, $query_id)
{
@@ -145,7 +139,7 @@ class phpbb_cache_driver_null extends phpbb_cache_driver_base
}
/**
- * Free memory used for a cached database result (database)
+ * {@inheritDoc}
*/
function sql_freeresult($query_id)
{
diff --git a/phpBB/phpbb/cache/driver/redis.php b/phpBB/phpbb/cache/driver/redis.php
index 960735b673..2f2a32a12d 100644
--- a/phpBB/phpbb/cache/driver/redis.php
+++ b/phpBB/phpbb/cache/driver/redis.php
@@ -7,13 +7,7 @@
*
*/
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
+namespace phpbb\cache\driver;
if (!defined('PHPBB_ACM_REDIS_PORT'))
{
@@ -33,7 +27,7 @@ if (!defined('PHPBB_ACM_REDIS_HOST'))
*
* @package acm
*/
-class phpbb_cache_driver_redis extends phpbb_cache_driver_memory
+class redis extends \phpbb\cache\driver\memory
{
var $extension = 'redis';
@@ -56,7 +50,7 @@ class phpbb_cache_driver_redis extends phpbb_cache_driver_memory
// Call the parent constructor
parent::__construct();
- $this->redis = new Redis();
+ $this->redis = new \Redis();
$args = func_get_args();
if (!empty($args))
@@ -83,8 +77,8 @@ class phpbb_cache_driver_redis extends phpbb_cache_driver_memory
}
}
- $this->redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP);
- $this->redis->setOption(Redis::OPT_PREFIX, $this->key_prefix);
+ $this->redis->setOption(\Redis::OPT_SERIALIZER, \Redis::SERIALIZER_PHP);
+ $this->redis->setOption(\Redis::OPT_PREFIX, $this->key_prefix);
if (defined('PHPBB_ACM_REDIS_DB'))
{
@@ -98,9 +92,7 @@ class phpbb_cache_driver_redis extends phpbb_cache_driver_memory
}
/**
- * Unload the cache resources
- *
- * @return null
+ * {@inheritDoc}
*/
function unload()
{
@@ -110,9 +102,7 @@ class phpbb_cache_driver_redis extends phpbb_cache_driver_memory
}
/**
- * Purge cache data
- *
- * @return null
+ * {@inheritDoc}
*/
function purge()
{
@@ -163,4 +153,3 @@ class phpbb_cache_driver_redis extends phpbb_cache_driver_memory
return false;
}
}
-
diff --git a/phpBB/phpbb/cache/driver/wincache.php b/phpBB/phpbb/cache/driver/wincache.php
index 58f3b4a581..d0f636d9cb 100644
--- a/phpBB/phpbb/cache/driver/wincache.php
+++ b/phpBB/phpbb/cache/driver/wincache.php
@@ -7,26 +7,18 @@
*
*/
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
+namespace phpbb\cache\driver;
/**
* ACM for WinCache
* @package acm
*/
-class phpbb_cache_driver_wincache extends phpbb_cache_driver_memory
+class wincache extends \phpbb\cache\driver\memory
{
var $extension = 'wincache';
/**
- * Purge cache data
- *
- * @return null
+ * {@inheritDoc}
*/
function purge()
{
diff --git a/phpBB/phpbb/cache/driver/xcache.php b/phpBB/phpbb/cache/driver/xcache.php
index 06c5fafd97..6c9323ec83 100644
--- a/phpBB/phpbb/cache/driver/xcache.php
+++ b/phpBB/phpbb/cache/driver/xcache.php
@@ -7,13 +7,7 @@
*
*/
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
+namespace phpbb\cache\driver;
/**
* ACM for XCache
@@ -24,7 +18,7 @@ if (!defined('IN_PHPBB'))
* - xcache.admin.enable_auth = off (or xcache.admin.user and xcache.admin.password set)
*
*/
-class phpbb_cache_driver_xcache extends phpbb_cache_driver_memory
+class xcache extends \phpbb\cache\driver\memory
{
var $extension = 'XCache';
@@ -39,9 +33,7 @@ class phpbb_cache_driver_xcache extends phpbb_cache_driver_memory
}
/**
- * Purge cache data
- *
- * @return null
+ * {@inheritDoc}
*/
function purge()
{
diff --git a/phpBB/phpbb/cache/service.php b/phpBB/phpbb/cache/service.php
index 69c5e0fdd0..f9b6324b05 100644
--- a/phpBB/phpbb/cache/service.php
+++ b/phpBB/phpbb/cache/service.php
@@ -7,38 +7,32 @@
*
*/
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
+namespace phpbb\cache;
/**
* Class for grabbing/handling cached entries
* @package acm
*/
-class phpbb_cache_service
+class service
{
/**
* Cache driver.
*
- * @var phpbb_cache_driver_interface
+ * @var \phpbb\cache\driver\driver_interface
*/
protected $driver;
/**
* The config.
*
- * @var phpbb_config
+ * @var \phpbb\config\config
*/
protected $config;
/**
* Database connection.
*
- * @var phpbb_db_driver
+ * @var \phpbb\db\driver\driver_interface
*/
protected $db;
@@ -59,13 +53,13 @@ class phpbb_cache_service
/**
* Creates a cache service around a cache driver
*
- * @param phpbb_cache_driver_interface $driver The cache driver
- * @param phpbb_config $config The config
- * @param phpbb_db_driver $db Database connection
+ * @param \phpbb\cache\driver\driver_interface $driver The cache driver
+ * @param \phpbb\config\config $config The config
+ * @param \phpbb\db\driver\driver_interface $db Database connection
* @param string $phpbb_root_path Root path
* @param string $php_ext PHP extension
*/
- public function __construct(phpbb_cache_driver_interface $driver, phpbb_config $config, phpbb_db_driver $db, $phpbb_root_path, $php_ext)
+ public function __construct(\phpbb\cache\driver\driver_interface $driver, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, $phpbb_root_path, $php_ext)
{
$this->set_driver($driver);
$this->config = $config;
@@ -77,7 +71,7 @@ class phpbb_cache_service
/**
* Returns the cache driver used by this cache service.
*
- * @return phpbb_cache_driver_interface The cache driver
+ * @return \phpbb\cache\driver\driver_interface The cache driver
*/
public function get_driver()
{
@@ -87,9 +81,9 @@ class phpbb_cache_service
/**
* Replaces the cache driver used by this cache service.
*
- * @param phpbb_cache_driver_interface $driver The cache driver
+ * @param \phpbb\cache\driver\driver_interface $driver The cache driver
*/
- public function set_driver(phpbb_cache_driver_interface $driver)
+ public function set_driver(\phpbb\cache\driver\driver_interface $driver)
{
$this->driver = $driver;
}