[Pkg-owncloud-commits] [owncloud] 04/165: Memcache\Redis Add DB Select Functionality

David Prévot taffit at moszumanska.debian.org
Thu Apr 23 04:06:13 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit 8ebf9de3f840f28f7c765cdf834369a46bcf8bea
Author: Michael Telatynski <7t3chguy at gmail.com>
Date:   Tue Apr 14 20:40:31 2015 +0100

    Memcache\Redis Add DB Select Functionality
---
 config/config.sample.php       | 5 +++--
 lib/private/memcache/redis.php | 5 +++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/config/config.sample.php b/config/config.sample.php
index e3b81f6..61ae595 100644
--- a/config/config.sample.php
+++ b/config/config.sample.php
@@ -420,7 +420,7 @@ $CONFIG = array(
  */
 
 /**
- * Checks an app before install whether it uses private APIs instead of the 
+ * Checks an app before install whether it uses private APIs instead of the
  * proper public APIs. If this is set to true it will only allow to install or
  * enable apps that pass this check.
  */
@@ -831,7 +831,8 @@ $CONFIG = array(
 'redis' => array(
 	'host' => 'localhost', // can also be a unix domain socket: '/tmp/redis.sock'
 	'port' => 6379,
-	'timeout' => 0.0
+	'timeout' => 0.0,
+	'dbindex' => 0, // Optional, if undefined SELECT will not run and will use Redis Server's default DB Index.
 ),
 
 /**
diff --git a/lib/private/memcache/redis.php b/lib/private/memcache/redis.php
index 62186d3..e742572 100644
--- a/lib/private/memcache/redis.php
+++ b/lib/private/memcache/redis.php
@@ -51,7 +51,12 @@ class Redis extends Cache {
 			} else {
 				$timeout = 0.0; // unlimited
 			}
+
 			self::$cache->connect( $host, $port, $timeout );
+
+			if (isset($config['dbindex'])) {
+				self::$cache->select( $config['dbindex'] );
+			}
 		}
 	}
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list