Merge pull request #15623 from t3chguy/master
Redis DB Index via Select
This commit is contained in:
commit
2e06cf49a5
|
@ -831,7 +831,8 @@ $CONFIG = array(
|
||||||
'redis' => array(
|
'redis' => array(
|
||||||
'host' => 'localhost', // can also be a unix domain socket: '/tmp/redis.sock'
|
'host' => 'localhost', // can also be a unix domain socket: '/tmp/redis.sock'
|
||||||
'port' => 6379,
|
'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.
|
||||||
),
|
),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -51,7 +51,12 @@ class Redis extends Cache {
|
||||||
} else {
|
} else {
|
||||||
$timeout = 0.0; // unlimited
|
$timeout = 0.0; // unlimited
|
||||||
}
|
}
|
||||||
|
|
||||||
self::$cache->connect( $host, $port, $timeout );
|
self::$cache->connect( $host, $port, $timeout );
|
||||||
|
|
||||||
|
if (isset($config['dbindex'])) {
|
||||||
|
self::$cache->select( $config['dbindex'] );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue