X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Flibs%2Fobjectcache%2FMemcachedClient.php;h=eecf7ec7997ec6ae0ca79d90873f4a41bff13722;hb=370bb99a9bb9836286af54856392ecabf09969f7;hp=937ca5546d854a38095260c840c8583037a51e9d;hpb=7621b57d958d0753236221227cbfb519d7faf192;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/objectcache/MemcachedClient.php b/includes/libs/objectcache/MemcachedClient.php index 937ca5546d..eecf7ec799 100644 --- a/includes/libs/objectcache/MemcachedClient.php +++ b/includes/libs/objectcache/MemcachedClient.php @@ -278,6 +278,23 @@ class MemcachedClient { } // }}} + + /** + * @param mixed $value + * @return string|integer + */ + public function serialize( $value ) { + return serialize( $value ); + } + + /** + * @param string $value + * @return mixed + */ + public function unserialize( $value ) { + return unserialize( $value ); + } + // {{{ add() /** @@ -503,7 +520,8 @@ class MemcachedClient { if ( $this->_debug ) { foreach ( $val as $k => $v ) { - $this->_debugprint( sprintf( "MemCache: sock %s got %s", serialize( $sock ), $k ) ); + $this->_debugprint( + sprintf( "MemCache: sock %s got %s", $this->serialize( $sock ), $k ) ); } } @@ -1018,7 +1036,7 @@ class MemcachedClient { * yet read "END"), these 2 calls would collide. */ if ( $flags & self::SERIALIZED ) { - $ret[$rkey] = unserialize( $ret[$rkey] ); + $ret[$rkey] = $this->unserialize( $ret[$rkey] ); } elseif ( $flags & self::INTVAL ) { $ret[$rkey] = intval( $ret[$rkey] ); } @@ -1072,7 +1090,7 @@ class MemcachedClient { if ( is_int( $val ) ) { $flags |= self::INTVAL; } elseif ( !is_scalar( $val ) ) { - $val = serialize( $val ); + $val = $this->serialize( $val ); $flags |= self::SERIALIZED; if ( $this->_debug ) { $this->_debugprint( sprintf( "client: serializing data as it is not scalar" ) );