Add default prefix to RedisEngine

This makes redis work like the other cache engines. Also by having
a default prefix the clear() method will not wipe all the data in the
current redis database.

Refs #4876
This commit is contained in:
mark_story 2014-10-14 22:47:34 -04:00
parent 1c440e2cb2
commit b86aae4d8b
2 changed files with 2 additions and 1 deletions

View file

@ -59,7 +59,7 @@ class RedisEngine extends CacheEngine {
}
parent::init(array_merge(array(
'engine' => 'Redis',
'prefix' => null,
'prefix' => Inflector::slug(APP_DIR) . '_',
'server' => '127.0.0.1',
'database' => 0,
'port' => 6379,

View file

@ -77,6 +77,7 @@ class RedisEngineTest extends CakeTestCase {
'persistent' => true,
'password' => false,
'database' => 0,
'unix_socket' => false,
);
$this->assertEquals($expecting, $settings);
}