diff options
Diffstat (limited to 'phpBB/includes/cache')
-rw-r--r-- | phpBB/includes/cache/driver/apc.php | 3 | ||||
-rw-r--r-- | phpBB/includes/cache/driver/base.php | 3 | ||||
-rw-r--r-- | phpBB/includes/cache/driver/eaccelerator.php | 3 | ||||
-rw-r--r-- | phpBB/includes/cache/driver/file.php | 7 | ||||
-rw-r--r-- | phpBB/includes/cache/driver/interface.php | 4 | ||||
-rw-r--r-- | phpBB/includes/cache/driver/memcache.php | 3 | ||||
-rw-r--r-- | phpBB/includes/cache/driver/memory.php | 9 | ||||
-rw-r--r-- | phpBB/includes/cache/driver/null.php | 5 | ||||
-rw-r--r--[-rwxr-xr-x] | phpBB/includes/cache/driver/redis.php | 16 | ||||
-rw-r--r-- | phpBB/includes/cache/driver/wincache.php | 2 | ||||
-rw-r--r-- | phpBB/includes/cache/driver/xcache.php | 3 | ||||
-rw-r--r-- | phpBB/includes/cache/factory.php | 43 | ||||
-rw-r--r-- | phpBB/includes/cache/service.php | 50 |
13 files changed, 39 insertions, 112 deletions
diff --git a/phpBB/includes/cache/driver/apc.php b/phpBB/includes/cache/driver/apc.php index a97cbe4dd1..dc0144fac3 100644 --- a/phpBB/includes/cache/driver/apc.php +++ b/phpBB/includes/cache/driver/apc.php @@ -2,9 +2,8 @@ /** * * @package acm -* @version $Id$ * @copyright (c) 2005, 2009 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/phpBB/includes/cache/driver/base.php b/phpBB/includes/cache/driver/base.php index a71eca45d7..32e04f813a 100644 --- a/phpBB/includes/cache/driver/base.php +++ b/phpBB/includes/cache/driver/base.php @@ -2,9 +2,8 @@ /** * * @package acm -* @version $Id$ * @copyright (c) 2010 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/phpBB/includes/cache/driver/eaccelerator.php b/phpBB/includes/cache/driver/eaccelerator.php index b2dd37dbb5..7939f043c9 100644 --- a/phpBB/includes/cache/driver/eaccelerator.php +++ b/phpBB/includes/cache/driver/eaccelerator.php @@ -2,9 +2,8 @@ /** * * @package acm -* @version $Id$ * @copyright (c) 2005, 2009 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/phpBB/includes/cache/driver/file.php b/phpBB/includes/cache/driver/file.php index 73eaff25bd..f64a9e3ea8 100644 --- a/phpBB/includes/cache/driver/file.php +++ b/phpBB/includes/cache/driver/file.php @@ -2,9 +2,8 @@ /** * * @package acm -* @version $Id$ * @copyright (c) 2005, 2009 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ @@ -365,7 +364,7 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base /** * Save sql query */ - function sql_save($query, &$query_result, $ttl) + function sql_save($query, $query_result, $ttl) { global $db; @@ -386,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/interface.php b/phpBB/includes/cache/driver/interface.php index 91d364abf6..847ba97262 100644 --- a/phpBB/includes/cache/driver/interface.php +++ b/phpBB/includes/cache/driver/interface.php @@ -3,7 +3,7 @@ * * @package acm * @copyright (c) 2010 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ @@ -75,7 +75,7 @@ interface phpbb_cache_driver_interface /** * Save sql query */ - public function sql_save($query, &$query_result, $ttl); + public function sql_save($query, $query_result, $ttl); /** * Ceck if a given sql query exist in cache diff --git a/phpBB/includes/cache/driver/memcache.php b/phpBB/includes/cache/driver/memcache.php index 46ba51049f..9fe70f8b44 100644 --- a/phpBB/includes/cache/driver/memcache.php +++ b/phpBB/includes/cache/driver/memcache.php @@ -2,9 +2,8 @@ /** * * @package acm -* @version $Id$ * @copyright (c) 2005, 2009 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/phpBB/includes/cache/driver/memory.php b/phpBB/includes/cache/driver/memory.php index 633a0fe699..e0771ab1d3 100644 --- a/phpBB/includes/cache/driver/memory.php +++ b/phpBB/includes/cache/driver/memory.php @@ -2,9 +2,8 @@ /** * * @package acm -* @version $Id$ * @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ @@ -20,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; @@ -281,7 +280,7 @@ class phpbb_cache_driver_memory extends phpbb_cache_driver_base /** * Save sql query */ - function sql_save($query, &$query_result, $ttl) + function sql_save($query, $query_result, $ttl) { global $db; @@ -336,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/null.php b/phpBB/includes/cache/driver/null.php index 0a520b572e..df2c6c026f 100644 --- a/phpBB/includes/cache/driver/null.php +++ b/phpBB/includes/cache/driver/null.php @@ -2,9 +2,8 @@ /** * * @package acm -* @version $Id$ * @copyright (c) 2005, 2009 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ @@ -108,7 +107,7 @@ class phpbb_cache_driver_null extends phpbb_cache_driver_base /** * Save sql query */ - function sql_save($query, &$query_result, $ttl) + function sql_save($query, $query_result, $ttl) { } diff --git a/phpBB/includes/cache/driver/redis.php b/phpBB/includes/cache/driver/redis.php index f0997c3cad..a768885962 100755..100644 --- a/phpBB/includes/cache/driver/redis.php +++ b/phpBB/includes/cache/driver/redis.php @@ -3,7 +3,7 @@ * * @package acm * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ @@ -25,12 +25,6 @@ if (!defined('PHPBB_ACM_REDIS_HOST')) define('PHPBB_ACM_REDIS_HOST', 'localhost'); } -if (!defined('PHPBB_ACM_REDIS')) -{ - //can define multiple servers with host1/port1,host2/port2 format - define('PHPBB_ACM_REDIS', PHPBB_ACM_REDIS_HOST . '/' . PHPBB_ACM_REDIS_PORT); -} - /** * ACM for Redis * @@ -51,12 +45,8 @@ class phpbb_cache_driver_redis extends phpbb_cache_driver_memory parent::__construct(); $this->redis = new Redis(); - foreach (explode(',', PHPBB_ACM_REDIS) as $server) - { - $parts = explode('/', $server); - $this->redis->connect(trim($parts[0]), trim($parts[1])); - } - + $this->redis->connect(PHPBB_ACM_REDIS_HOST, PHPBB_ACM_REDIS_PORT); + if (defined('PHPBB_ACM_REDIS_PASSWORD')) { if (!$this->redis->auth(PHPBB_ACM_REDIS_PASSWORD)) diff --git a/phpBB/includes/cache/driver/wincache.php b/phpBB/includes/cache/driver/wincache.php index 2e1a138ee9..fa9eb95f88 100644 --- a/phpBB/includes/cache/driver/wincache.php +++ b/phpBB/includes/cache/driver/wincache.php @@ -3,7 +3,7 @@ * * @package acm * @copyright (c) 2010 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/phpBB/includes/cache/driver/xcache.php b/phpBB/includes/cache/driver/xcache.php index 9363ff501d..0b768bdb3e 100644 --- a/phpBB/includes/cache/driver/xcache.php +++ b/phpBB/includes/cache/driver/xcache.php @@ -2,9 +2,8 @@ /** * * @package acm -* @version $Id$ * @copyright (c) 2005, 2009 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/phpBB/includes/cache/factory.php b/phpBB/includes/cache/factory.php deleted file mode 100644 index f38e19cbe6..0000000000 --- a/phpBB/includes/cache/factory.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php -/** -* -* @package acm -* @version $Id$ -* @copyright (c) 2010 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License -* -*/ - -/** -* @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 0c01953d55..e63ec6e33a 100644 --- a/phpBB/includes/cache/service.php +++ b/phpBB/includes/cache/service.php @@ -3,7 +3,7 @@ * * @package acm * @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ @@ -321,50 +321,34 @@ class phpbb_cache_service /** * Obtain cfg file data */ - function obtain_cfg_items($theme) + function obtain_cfg_items($style) { global $config, $phpbb_root_path; - $parsed_items = array( - 'theme' => array(), - 'template' => array(), - 'imageset' => array() - ); + $parsed_array = $this->driver->get('_cfg_' . $style['style_path']); - foreach ($parsed_items as $key => $parsed_array) + if ($parsed_array === false) { - $parsed_array = $this->driver->get('_cfg_' . $key . '_' . $theme[$key . '_path']); - - if ($parsed_array === false) - { - $parsed_array = array(); - } - - $reparse = false; - $filename = $phpbb_root_path . 'styles/' . $theme[$key . '_path'] . '/' . $key . '/' . $key . '.cfg'; + $parsed_array = array(); + } - if (!file_exists($filename)) - { - continue; - } + $filename = $phpbb_root_path . 'styles/' . $style['style_path'] . '/style.cfg'; - if (!isset($parsed_array['filetime']) || (($config['load_tplcompile'] && @filemtime($filename) > $parsed_array['filetime']))) - { - $reparse = true; - } + if (!file_exists($filename)) + { + return $parsed_array; + } + if (!isset($parsed_array['filetime']) || (($config['load_tplcompile'] && @filemtime($filename) > $parsed_array['filetime']))) + { // Re-parse cfg file - if ($reparse) - { - $parsed_array = parse_cfg_file($filename); - $parsed_array['filetime'] = @filemtime($filename); + $parsed_array = parse_cfg_file($filename); + $parsed_array['filetime'] = @filemtime($filename); - $this->driver->put('_cfg_' . $key . '_' . $theme[$key . '_path'], $parsed_array); - } - $parsed_items[$key] = $parsed_array; + $this->driver->put('_cfg_' . $style['style_path'], $parsed_array); } - return $parsed_items; + return $parsed_array; } /** |