diff options
Diffstat (limited to 'phpBB/phpbb/cache/driver')
| -rw-r--r-- | phpBB/phpbb/cache/driver/apc.php | 4 | ||||
| -rw-r--r-- | phpBB/phpbb/cache/driver/base.php | 4 | ||||
| -rw-r--r-- | phpBB/phpbb/cache/driver/driver_interface.php (renamed from phpBB/phpbb/cache/driver/interface.php) | 12 | ||||
| -rw-r--r-- | phpBB/phpbb/cache/driver/eaccelerator.php | 4 | ||||
| -rw-r--r-- | phpBB/phpbb/cache/driver/file.php | 16 | ||||
| -rw-r--r-- | phpBB/phpbb/cache/driver/memcache.php | 6 | ||||
| -rw-r--r-- | phpBB/phpbb/cache/driver/memory.php | 6 | ||||
| -rw-r--r-- | phpBB/phpbb/cache/driver/null.php | 6 | ||||
| -rw-r--r-- | phpBB/phpbb/cache/driver/redis.php | 10 | ||||
| -rw-r--r-- | phpBB/phpbb/cache/driver/wincache.php | 4 | ||||
| -rw-r--r-- | phpBB/phpbb/cache/driver/xcache.php | 4 | 
11 files changed, 49 insertions, 27 deletions
| diff --git a/phpBB/phpbb/cache/driver/apc.php b/phpBB/phpbb/cache/driver/apc.php index 0516b669c8..ce72ec6134 100644 --- a/phpBB/phpbb/cache/driver/apc.php +++ b/phpBB/phpbb/cache/driver/apc.php @@ -7,6 +7,8 @@  *  */ +namespace phpbb\cache\driver; +  /**  * @ignore  */ @@ -19,7 +21,7 @@ if (!defined('IN_PHPBB'))  * 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'; diff --git a/phpBB/phpbb/cache/driver/base.php b/phpBB/phpbb/cache/driver/base.php index 32e04f813a..90185a00d2 100644 --- a/phpBB/phpbb/cache/driver/base.php +++ b/phpBB/phpbb/cache/driver/base.php @@ -7,6 +7,8 @@  *  */ +namespace phpbb\cache\driver; +  /**  * @ignore  */ @@ -18,6 +20,6 @@ if (!defined('IN_PHPBB'))  /**  * @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..34c60b5935 100644 --- a/phpBB/phpbb/cache/driver/interface.php +++ b/phpBB/phpbb/cache/driver/driver_interface.php @@ -7,6 +7,8 @@  *  */ +namespace phpbb\cache\driver; +  /**  * @ignore  */ @@ -20,7 +22,7 @@ if (!defined('IN_PHPBB'))  *  * @package acm  */ -interface phpbb_cache_driver_interface +interface driver_interface  {  	/**  	* Load global cache @@ -85,10 +87,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 $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 +98,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 $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..72c0d77d02 100644 --- a/phpBB/phpbb/cache/driver/eaccelerator.php +++ b/phpBB/phpbb/cache/driver/eaccelerator.php @@ -7,6 +7,8 @@  *  */ +namespace phpbb\cache\driver; +  /**  * @ignore  */ @@ -20,7 +22,7 @@ if (!defined('IN_PHPBB'))  * @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'; diff --git a/phpBB/phpbb/cache/driver/file.php b/phpBB/phpbb/cache/driver/file.php index 944dfd6541..a64232400b 100644 --- a/phpBB/phpbb/cache/driver/file.php +++ b/phpBB/phpbb/cache/driver/file.php @@ -7,6 +7,8 @@  *  */ +namespace phpbb\cache\driver; +  /**  * @ignore  */ @@ -19,7 +21,7 @@ if (!defined('IN_PHPBB'))  * 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(); @@ -205,9 +207,9 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base  	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 +258,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)  		{ @@ -413,7 +415,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 $db, $query, $query_result, $ttl)  	{  		// Remove extra spaces and tabs  		$query = preg_replace('/[\n\r\s\t]+/', ' ', $query); @@ -695,7 +697,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')) diff --git a/phpBB/phpbb/cache/driver/memcache.php b/phpBB/phpbb/cache/driver/memcache.php index 3fd16b23b0..84fe68ae49 100644 --- a/phpBB/phpbb/cache/driver/memcache.php +++ b/phpBB/phpbb/cache/driver/memcache.php @@ -7,6 +7,8 @@  *  */ +namespace phpbb\cache\driver; +  /**  * @ignore  */ @@ -40,7 +42,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 +54,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); diff --git a/phpBB/phpbb/cache/driver/memory.php b/phpBB/phpbb/cache/driver/memory.php index f77a1df316..5a9861913f 100644 --- a/phpBB/phpbb/cache/driver/memory.php +++ b/phpBB/phpbb/cache/driver/memory.php @@ -7,6 +7,8 @@  *  */ +namespace phpbb\cache\driver; +  /**  * @ignore  */ @@ -19,7 +21,7 @@ if (!defined('IN_PHPBB'))  * 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; @@ -285,7 +287,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 $db, $query, $query_result, $ttl)  	{  		// Remove extra spaces and tabs  		$query = preg_replace('/[\n\r\s\t]+/', ' ', $query); diff --git a/phpBB/phpbb/cache/driver/null.php b/phpBB/phpbb/cache/driver/null.php index 2fadc27ba3..c03319ad61 100644 --- a/phpBB/phpbb/cache/driver/null.php +++ b/phpBB/phpbb/cache/driver/null.php @@ -7,6 +7,8 @@  *  */ +namespace phpbb\cache\driver; +  /**  * @ignore  */ @@ -19,7 +21,7 @@ if (!defined('IN_PHPBB'))  * 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 @@ -107,7 +109,7 @@ 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 $db, $query, $query_result, $ttl)  	{  		return $query_result;  	} diff --git a/phpBB/phpbb/cache/driver/redis.php b/phpBB/phpbb/cache/driver/redis.php index 960735b673..317d07428a 100644 --- a/phpBB/phpbb/cache/driver/redis.php +++ b/phpBB/phpbb/cache/driver/redis.php @@ -7,6 +7,8 @@  *  */ +namespace phpbb\cache\driver; +  /**  * @ignore  */ @@ -33,7 +35,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 +58,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 +85,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'))  		{ diff --git a/phpBB/phpbb/cache/driver/wincache.php b/phpBB/phpbb/cache/driver/wincache.php index 58f3b4a581..a0b24e4a1f 100644 --- a/phpBB/phpbb/cache/driver/wincache.php +++ b/phpBB/phpbb/cache/driver/wincache.php @@ -7,6 +7,8 @@  *  */ +namespace phpbb\cache\driver; +  /**  * @ignore  */ @@ -19,7 +21,7 @@ if (!defined('IN_PHPBB'))  * 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'; diff --git a/phpBB/phpbb/cache/driver/xcache.php b/phpBB/phpbb/cache/driver/xcache.php index 06c5fafd97..fdcbf7e4b5 100644 --- a/phpBB/phpbb/cache/driver/xcache.php +++ b/phpBB/phpbb/cache/driver/xcache.php @@ -7,6 +7,8 @@  *  */ +namespace phpbb\cache\driver; +  /**  * @ignore  */ @@ -24,7 +26,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'; | 
