@@ -11,7 +11,7 @@ class CacheManager extends Manager {
1111 */
1212 protected function createApcDriver ()
1313 {
14- return $ this ->repository (new ApcStore (new ApcWrapper ));
14+ return $ this ->repository (new ApcStore (new ApcWrapper , $ this -> getPrefix () ));
1515 }
1616
1717 /**
@@ -47,7 +47,7 @@ protected function createMemcachedDriver()
4747
4848 $ memcached = $ this ->app ['memcached.connector ' ]->connect ($ servers );
4949
50- return $ this ->repository (new MemcachedStore ($ memcached , $ this ->app [ ' config ' ][ ' cache.prefix ' ] ));
50+ return $ this ->repository (new MemcachedStore ($ memcached , $ this ->getPrefix () ));
5151 }
5252
5353 /**
@@ -57,7 +57,7 @@ protected function createMemcachedDriver()
5757 */
5858 protected function createWincacheDriver ()
5959 {
60- return $ this ->repository (new WinCacheStore ($ this ->app [ ' config ' ][ ' cache.prefix ' ] ));
60+ return $ this ->repository (new WinCacheStore ($ this ->getPrefix () ));
6161 }
6262
6363 /**
@@ -69,7 +69,7 @@ protected function createRedisDriver()
6969 {
7070 $ redis = $ this ->app ['redis ' ];
7171
72- return $ this ->repository (new RedisStore ($ redis , $ this ->app [ ' config ' ][ ' cache.prefix ' ] ));
72+ return $ this ->repository (new RedisStore ($ redis , $ this ->getPrefix () ));
7373 }
7474
7575 /**
@@ -88,7 +88,7 @@ protected function createDatabaseDriver()
8888 // is being used by multiple applications although this is very unlikely.
8989 $ table = $ this ->app ['config ' ]['cache.table ' ];
9090
91- $ prefix = $ this ->app [ ' config ' ][ ' cache.prefix ' ] ;
91+ $ prefix = $ this ->getPrefix () ;
9292
9393 return $ this ->repository (new DatabaseStore ($ connection , $ encrypter , $ table , $ prefix ));
9494 }
@@ -105,6 +105,16 @@ protected function getDatabaseConnection()
105105 return $ this ->app ['db ' ]->connection ($ connection );
106106 }
107107
108+ /**
109+ * Get the cache "prefix" value.
110+ *
111+ * @return string
112+ */
113+ public function getPrefix ()
114+ {
115+ return $ this ->app ['config ' ]['cache.prefix ' ];
116+ }
117+
108118 /**
109119 * Create a new cache repository with the given implementation.
110120 *
0 commit comments