Permalink
Browse files

made prefix as a setter dependency

  • Loading branch information...
1 parent 5972e31 commit 825dbbe52728c918df6a488afbf8c3f3fb3cd8ec @ebaioni ebaioni committed May 27, 2013
Showing with 11 additions and 3 deletions.
  1. +9 −2 Client/MemcacheClient.php
  2. +2 −1 Resources/config/services.yml
View
@@ -27,10 +27,9 @@ class MemcacheClient implements CacheClientInterface
*
* @access public
*/
- public function __construct(\Memcache $memcache, $prefix)
+ public function __construct(\Memcache $memcache)
{
$this->mem = $memcache;
- $this->prefix = $prefix;
}
/**
@@ -190,4 +189,12 @@ public function getStats()
{
return $this->mem->getExtendedStats();
}
+
+ /**
+ * @param string $prefix
+ */
+ public function setPrefix($prefix)
+ {
+ $this->prefix = $prefix;
+ }
}
@@ -10,9 +10,10 @@ services:
class: %beryllium_cache.client.memcache.class%
beryllium_cache.client:
class: %beryllium_cache.client.class%
- arguments: [@beryllium_cache.client.memcache, %beryllium_cache.client.prefix%]
+ arguments: [@beryllium_cache.client.memcache]
calls:
- [ addServers, [ %beryllium_cache.client.servers% ] ]
+ - [ setPrefix, [ %beryllium_cache.client.prefix% ] ]
beryllium_cache:
class: %beryllium_cache.class%
calls:

0 comments on commit 825dbbe

Please sign in to comment.