]> source.dussan.org Git - nextcloud-server.git/commitdiff
Memcache\Redis Add DB Select Functionality
authorMichael Telatynski <7t3chguy@gmail.com>
Tue, 14 Apr 2015 19:40:31 +0000 (20:40 +0100)
committerMichael Telatynski <7t3chguy@gmail.com>
Wed, 15 Apr 2015 20:24:38 +0000 (21:24 +0100)
config/config.sample.php
lib/private/memcache/redis.php

index e3b81f69f6bde65052b30b791bc1d8de2d232a1f..61ae59542d431bd4dc0fa2c508cc37a8a314f5d4 100644 (file)
@@ -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.
 ),
 
 /**
index 62186d3c4ece06673dc2a8374d7387e0a1e3ff97..e7425726b2b299470576d5057defbdce7673a691 100644 (file)
@@ -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'] );
+                       }
                }
        }