From a1789ddde42033f1b05cc4929491214ee6e79383 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 17 Dec 2015 09:15:42 +0100 Subject: Update to MediaWiki 1.26.0 --- includes/objectcache/MemcachedClient.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'includes/objectcache/MemcachedClient.php') diff --git a/includes/objectcache/MemcachedClient.php b/includes/objectcache/MemcachedClient.php index bc4a00b2..5010b899 100644 --- a/includes/objectcache/MemcachedClient.php +++ b/includes/objectcache/MemcachedClient.php @@ -94,6 +94,11 @@ class MWMemcached { */ const COMPRESSED = 2; + /** + * Flag: indicates data is an integer + */ + const INTVAL = 4; + // }}} /** @@ -745,13 +750,13 @@ class MWMemcached { $timeout = $this->_connect_timeout; $errno = $errstr = null; for ( $i = 0; !$sock && $i < $this->_connect_attempts; $i++ ) { - wfSuppressWarnings(); + MediaWiki\suppressWarnings(); if ( $this->_persistent == 1 ) { $sock = pfsockopen( $ip, $port, $errno, $errstr, $timeout ); } else { $sock = fsockopen( $ip, $port, $errno, $errstr, $timeout ); } - wfRestoreWarnings(); + MediaWiki\restoreWarnings(); } if ( !$sock ) { $this->_error_log( "Error connecting to $host: $errstr\n" ); @@ -979,6 +984,8 @@ class MWMemcached { */ if ( $flags & self::SERIALIZED ) { $ret[$rkey] = unserialize( $ret[$rkey] ); + } elseif ( $flags & self::INTVAL ) { + $ret[$rkey] = intval( $ret[$rkey] ); } } @@ -1027,7 +1034,9 @@ class MWMemcached { $flags = 0; - if ( !is_scalar( $val ) ) { + if ( is_int( $val ) ) { + $flags |= self::INTVAL; + } elseif ( !is_scalar( $val ) ) { $val = serialize( $val ); $flags |= self::SERIALIZED; if ( $this->_debug ) { -- cgit v1.2.3-54-g00ecf