From 63601400e476c6cf43d985f3e7b9864681695ed4 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 18 Jan 2013 16:46:04 +0100 Subject: Update to MediaWiki 1.20.2 this update includes: * adjusted Arch Linux skin * updated FluxBBAuthPlugin * patch for https://bugzilla.wikimedia.org/show_bug.cgi?id=44024 --- includes/objectcache/XCacheBagOStuff.php | 44 +++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) (limited to 'includes/objectcache/XCacheBagOStuff.php') diff --git a/includes/objectcache/XCacheBagOStuff.php b/includes/objectcache/XCacheBagOStuff.php index 0ddf1245..bc68b596 100644 --- a/includes/objectcache/XCacheBagOStuff.php +++ b/includes/objectcache/XCacheBagOStuff.php @@ -1,4 +1,25 @@ isInteger( $val ) ) { + $val = intval( $val ); + } else { + $val = unserialize( $val ); + } + } elseif ( is_null( $val ) ) { + return false; } return $val; @@ -32,7 +59,11 @@ class XCacheBagOStuff extends BagOStuff { * @return bool */ public function set( $key, $value, $expire = 0 ) { - xcache_set( $key, serialize( $value ), $expire ); + if ( !$this->isInteger( $value ) ) { + $value = serialize( $value ); + } + + xcache_set( $key, $value, $expire ); return true; } @@ -47,5 +78,12 @@ class XCacheBagOStuff extends BagOStuff { xcache_unset( $key ); return true; } -} + public function incr( $key, $value = 1 ) { + return xcache_inc( $key, $value ); + } + + public function decr( $key, $value = 1 ) { + return xcache_dec( $key, $value ); + } +} -- cgit v1.2.3-54-g00ecf