aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/cache
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2012-11-12 10:33:40 +0100
committerIgor Wiedler <igor@wiedler.ch>2012-11-12 10:33:40 +0100
commit5e52216b5e14ced69326813e748fc56be6e28a69 (patch)
tree4e47bd9290da80da48aaf30308e7d03965a904f6 /phpBB/includes/cache
parent0971d3f975ebaa8c2874115bd82b308b244783f2 (diff)
parent504158ceaba18bb8bc61d54504a2c870d0eb0407 (diff)
downloadforums-5e52216b5e14ced69326813e748fc56be6e28a69.tar
forums-5e52216b5e14ced69326813e748fc56be6e28a69.tar.gz
forums-5e52216b5e14ced69326813e748fc56be6e28a69.tar.bz2
forums-5e52216b5e14ced69326813e748fc56be6e28a69.tar.xz
forums-5e52216b5e14ced69326813e748fc56be6e28a69.zip
Merge remote-tracking branch 'upstream/develop' into ticket/11015
* upstream/develop: (666 commits) [ticket/11077] Remove code from old global announcements system [ticket/11189] Replace DEBUG_EXTRA with DEBUG [ticket/11189] Always log critical errors when in cron or in image output [ticket/11187] Added a blank array to fix errors in functional tests [ticket/10780] Make L_COLON available in the installer. [ticket/11183] Remove $load_extensions and weird dl() calls [ticket/10970] Added extra documentation to parse_dynamic_path. [ticket/10939] Added documentation for phpbb_request::file [ticket/10865] Use code tags for install/database_update.php. [ticket/10865] Should have been a slash. [ticket/10780] Use L_COLON on LDAP page. [ticket/10780] Use L_COLON on search backend ACP pages. [ticket/10780] Use L_COLON for "download all attachments". [ticket/10780] Use colon from language in ucp_pm_compose.php where possible. [ticket/10780] Replace colons in phpBB/adm/style/acp_ext_details.html. [ticket/10780] Replace colon usage in adm template output with {L_COLON} [ticket/10780] Replace colon usage in template output with {L_COLON} [ticket/11181] Bump PHP requirement to 5.3.3 (from 5.3.2) [develop-olympus] [ticket/11181] Bump PHP requirement to 5.3.3 (from 5.3.2) [ticket/10172] Show prosilver birthday list even if there are no birthdays. ... Conflicts: phpBB/common.php phpBB/download/file.php phpBB/includes/db/dbal.php phpBB/includes/db/firebird.php phpBB/includes/db/mssql.php phpBB/includes/db/mssql_odbc.php phpBB/includes/db/mssqlnative.php phpBB/includes/db/mysql.php phpBB/includes/db/mysqli.php phpBB/includes/db/oracle.php phpBB/includes/db/postgres.php phpBB/includes/db/sqlite.php phpBB/includes/extension/manager.php phpBB/install/database_update.php
Diffstat (limited to 'phpBB/includes/cache')
-rw-r--r--phpBB/includes/cache/driver/file.php2
-rw-r--r--phpBB/includes/cache/driver/memory.php4
-rw-r--r--[-rwxr-xr-x]phpBB/includes/cache/driver/redis.php0
-rw-r--r--phpBB/includes/cache/factory.php42
-rw-r--r--phpBB/includes/cache/service.php51
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());
+ }
}