aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/cache/driver/redis.php
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2012-12-07 21:14:39 -0600
committerNathan Guse <nathaniel.guse@gmail.com>2012-12-07 21:14:39 -0600
commit0042f071476b75258f5f8ea0b5b9fcb445ffde23 (patch)
tree67cbafd7c655ad94809fef5f7dbe3a23525b232b /phpBB/includes/cache/driver/redis.php
parentc911a34b5b7541b46ee2408da366d2dc7c302090 (diff)
parentb7b8fefdd084b51c93b15dfdfb34d2ef294f4d76 (diff)
downloadforums-0042f071476b75258f5f8ea0b5b9fcb445ffde23.tar
forums-0042f071476b75258f5f8ea0b5b9fcb445ffde23.tar.gz
forums-0042f071476b75258f5f8ea0b5b9fcb445ffde23.tar.bz2
forums-0042f071476b75258f5f8ea0b5b9fcb445ffde23.tar.xz
forums-0042f071476b75258f5f8ea0b5b9fcb445ffde23.zip
Merge branch 'develop' of github.com:EXreaction/phpbb3 into ticket/11103
Conflicts: phpBB/install/database_update.php phpBB/styles/prosilver/template/ucp_prefs_personal.html phpBB/styles/subsilver2/template/ucp_prefs_personal.html
Diffstat (limited to 'phpBB/includes/cache/driver/redis.php')
-rw-r--r--phpBB/includes/cache/driver/redis.php32
1 files changed, 29 insertions, 3 deletions
diff --git a/phpBB/includes/cache/driver/redis.php b/phpBB/includes/cache/driver/redis.php
index a768885962..960735b673 100644
--- a/phpBB/includes/cache/driver/redis.php
+++ b/phpBB/includes/cache/driver/redis.php
@@ -39,13 +39,39 @@ class phpbb_cache_driver_redis extends phpbb_cache_driver_memory
var $redis;
+ /**
+ * Creates a redis cache driver.
+ *
+ * The following global constants affect operation:
+ *
+ * PHPBB_ACM_REDIS_HOST
+ * PHPBB_ACM_REDIS_PORT
+ * PHPBB_ACM_REDIS_PASSWORD
+ * PHPBB_ACM_REDIS_DB
+ *
+ * There are no publicly documented constructor parameters.
+ */
function __construct()
{
// Call the parent constructor
parent::__construct();
$this->redis = new Redis();
- $this->redis->connect(PHPBB_ACM_REDIS_HOST, PHPBB_ACM_REDIS_PORT);
+
+ $args = func_get_args();
+ if (!empty($args))
+ {
+ $ok = call_user_func_array(array($this->redis, 'connect'), $args);
+ }
+ else
+ {
+ $ok = $this->redis->connect(PHPBB_ACM_REDIS_HOST, PHPBB_ACM_REDIS_PORT);
+ }
+
+ if (!$ok)
+ {
+ trigger_error('Could not connect to redis server');
+ }
if (defined('PHPBB_ACM_REDIS_PASSWORD'))
{
@@ -74,7 +100,7 @@ class phpbb_cache_driver_redis extends phpbb_cache_driver_memory
/**
* Unload the cache resources
*
- * @return void
+ * @return null
*/
function unload()
{
@@ -86,7 +112,7 @@ class phpbb_cache_driver_redis extends phpbb_cache_driver_memory
/**
* Purge cache data
*
- * @return void
+ * @return null
*/
function purge()
{