diff options
Diffstat (limited to 'phpBB/includes/cache')
-rw-r--r-- | phpBB/includes/cache/driver/file.php | 2 | ||||
-rw-r--r-- | phpBB/includes/cache/driver/memory.php | 4 | ||||
-rw-r--r--[-rwxr-xr-x] | phpBB/includes/cache/driver/redis.php | 0 | ||||
-rw-r--r-- | phpBB/includes/cache/factory.php | 42 | ||||
-rw-r--r-- | phpBB/includes/cache/service.php | 51 |
5 files changed, 48 insertions, 51 deletions
diff --git a/phpBB/includes/cache/driver/file.php b/phpBB/includes/cache/driver/file.php index 0d3b06f621..ced45b29ea 100644 --- a/phpBB/includes/cache/driver/file.php +++ b/phpBB/includes/cache/driver/file.php @@ -385,6 +385,8 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base { $query_result = $query_id; } + + return $query_id; } /** diff --git a/phpBB/includes/cache/driver/memory.php b/phpBB/includes/cache/driver/memory.php index e25c9229a1..6142b6f65d 100644 --- a/phpBB/includes/cache/driver/memory.php +++ b/phpBB/includes/cache/driver/memory.php @@ -19,7 +19,7 @@ if (!defined('IN_PHPBB')) * ACM Abstract Memory Class * @package acm */ -class phpbb_cache_driver_memory extends phpbb_cache_driver_base +abstract class phpbb_cache_driver_memory extends phpbb_cache_driver_base { var $key_prefix; @@ -335,6 +335,8 @@ class phpbb_cache_driver_memory extends phpbb_cache_driver_base $this->_write('sql_' . $hash, $this->sql_rowset[$query_id], $ttl); $query_result = $query_id; + + return $query_id; } /** diff --git a/phpBB/includes/cache/driver/redis.php b/phpBB/includes/cache/driver/redis.php index a768885962..a768885962 100755..100644 --- a/phpBB/includes/cache/driver/redis.php +++ b/phpBB/includes/cache/driver/redis.php diff --git a/phpBB/includes/cache/factory.php b/phpBB/includes/cache/factory.php deleted file mode 100644 index 01c4d0b901..0000000000 --- a/phpBB/includes/cache/factory.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** -* -* @package acm -* @copyright (c) 2010 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 -* -*/ - -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - -/** -* @package acm -*/ -class phpbb_cache_factory -{ - private $acm_type; - - public function __construct($acm_type) - { - $this->acm_type = $acm_type; - } - - public function get_driver() - { - $class_name = 'phpbb_cache_driver_' . $this->acm_type; - return new $class_name(); - } - - public function get_service() - { - $driver = $this->get_driver(); - $service = new phpbb_cache_service($driver); - return $service; - } -} diff --git a/phpBB/includes/cache/service.php b/phpBB/includes/cache/service.php index 37f32aa753..7858e27a5c 100644 --- a/phpBB/includes/cache/service.php +++ b/phpBB/includes/cache/service.php @@ -58,6 +58,11 @@ class phpbb_cache_service return call_user_func_array(array($this->driver, $method), $arguments); } + public function __get($var) + { + return $this->driver->$var; + } + /** * Obtain list of naughty words and build preg style replacement arrays for use by the * calling script @@ -332,27 +337,22 @@ class phpbb_cache_service $parsed_array = array(); } - $reparse = false; $filename = $phpbb_root_path . 'styles/' . $style['style_path'] . '/style.cfg'; if (!file_exists($filename)) { - continue; + return $parsed_array; } if (!isset($parsed_array['filetime']) || (($config['load_tplcompile'] && @filemtime($filename) > $parsed_array['filetime']))) { - $reparse = true; - } - - // Re-parse cfg file - if ($reparse) - { + // Re-parse cfg file $parsed_array = parse_cfg_file($filename); $parsed_array['filetime'] = @filemtime($filename); $this->driver->put('_cfg_' . $style['style_path'], $parsed_array); } + return $parsed_array; } @@ -413,4 +413,39 @@ class phpbb_cache_service return $hook_files; } + + public function sql_load() + { + return call_user_func_array(array($this->driver, __FUNCTION__), func_get_args()); + } + + public function sql_save($query, &$query_result, $ttl) + { + return call_user_func_array(array($this->driver, __FUNCTION__), array($query, &$query_result, $ttl)); + } + + public function sql_exists() + { + return call_user_func_array(array($this->driver, __FUNCTION__), func_get_args()); + } + + public function sql_fetchrow() + { + return call_user_func_array(array($this->driver, __FUNCTION__), func_get_args()); + } + + public function sql_fetchfield() + { + return call_user_func_array(array($this->driver, __FUNCTION__), func_get_args()); + } + + public function sql_rowseek() + { + return call_user_func_array(array($this->driver, __FUNCTION__), func_get_args()); + } + + public function sql_freeresult() + { + return call_user_func_array(array($this->driver, __FUNCTION__), func_get_args()); + } } |