X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Flibs%2Fobjectcache%2FWinCacheBagOStuff.php;h=9d7e1436821e5dc1470ee422c63dcc5db76f3262;hb=50a72860b6eab430160a9504926c6aafa4fb701d;hp=8c419b22cd7b7a8788807ff53749d7f378c2323a;hpb=aac6b26c0bafc81287bb042304f1d346da94dc89;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/objectcache/WinCacheBagOStuff.php b/includes/libs/objectcache/WinCacheBagOStuff.php index 8c419b22cd..9d7e143682 100644 --- a/includes/libs/objectcache/WinCacheBagOStuff.php +++ b/includes/libs/objectcache/WinCacheBagOStuff.php @@ -36,7 +36,7 @@ class WinCacheBagOStuff extends BagOStuff { return false; } - $value = unserialize( $blob ); + $value = $this->unserialize( $blob ); if ( $value !== false ) { $casToken = (string)$blob; // don't bother hashing this } @@ -67,8 +67,8 @@ class WinCacheBagOStuff extends BagOStuff { return $success; } - public function set( $key, $value, $expire = 0, $flags = 0 ) { - $result = wincache_ucache_set( $key, serialize( $value ), $expire ); + protected function doSet( $key, $value, $expire = 0, $flags = 0 ) { + $result = wincache_ucache_set( $key, $this->serialize( $value ), $expire ); // false positive, wincache_ucache_set returns an empty array // in some circumstances. @@ -77,7 +77,11 @@ class WinCacheBagOStuff extends BagOStuff { } public function add( $key, $value, $exptime = 0, $flags = 0 ) { - $result = wincache_ucache_add( $key, serialize( $value ), $exptime ); + if ( wincache_ucache_exists( $key ) ) { + return false; // avoid warnings + } + + $result = wincache_ucache_add( $key, $this->serialize( $value ), $exptime ); // false positive, wincache_ucache_add returns an empty array // in some circumstances. @@ -85,7 +89,7 @@ class WinCacheBagOStuff extends BagOStuff { return ( $result === [] || $result === true ); } - public function delete( $key, $flags = 0 ) { + protected function doDelete( $key, $flags = 0 ) { wincache_ucache_delete( $key ); return true;