Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: cache.php
- ===================================================================
- --- cache.php (revision 11714)
- +++ cache.php (working copy)
- @@ -124,6 +124,7 @@
- */
- public function add($key, $val, $compressed = false, $expire = 0) {
- $key = $this->normalizeKey($key);
- + $compressed = $this->compressed($compressed);
- return $this->cache->add($this->prefix.$key, $val, $compressed, $expire);
- }
- @@ -206,6 +207,7 @@
- */
- public function replace($key, $val, $compressed = false, $expire = 0) {
- $key = $this->normalizeKey($key);
- + $compressed = $this->compressed($compressed);
- return $this->cache->replace($this->prefix.$key, $val, $compressed, $expire);
- }
- @@ -222,6 +224,7 @@
- */
- public function set($key, $val, $compressed = false, $expire = 0) {
- $key = $this->normalizeKey($key);
- + $compressed = $this->compressed($compressed);
- return $this->cache->set($this->prefix.$key, $val, $compressed, $expire);
- }
- @@ -258,4 +261,13 @@
- protected function normalizeKey($key) {
- return str_replace(' ', '_', $key);
- }
- +
- + /**
- + * The compressed argument on Memcache::add, Memcache::set and Memcache::replace takes
- + * an integer not a boolean. Since pecl/memcache 3.0.3 booleans now leads to warnings like
- + * The lowest two bytes of the flags array is reserved for pecl/memcache internal use
- + */
- + protected function compressed($compressed) {
- + return $compressed == false ? 0 : MEMCACHE_COMPRESSED;
- + }
- }
Add Comment
Please, Sign In to add comment