wikitext table captions, wikitext table headings, wikitext table cells. HTML
headings, HTML list items, HTML table captions, HTML table headings, HTML
table cells will not have this trimming behavior.
+* (T196125) php-memcached 3.0 (provided with PHP 7.0) is now supported.
== Compatibility ==
MediaWiki 1.31 requires PHP 7.0.0 or later. Although HHVM 3.18.5 or later is
protected function getWithToken( $key, &$casToken, $flags = 0 ) {
$this->debugLog( "get($key)" );
- $result = $this->client->get( $this->validateKeyEncoding( $key ), null, $casToken );
+ if ( defined( Memcached::class . '::GET_EXTENDED' ) ) { // v3.0.0
+ $flags = Memcached::GET_EXTENDED;
+ $res = $this->client->get( $this->validateKeyEncoding( $key ), null, $flags );
+ if ( is_array( $res ) ) {
+ $result = $res['value'];
+ $casToken = $res['cas'];
+ } else {
+ $result = false;
+ $casToken = null;
+ }
+ } else {
+ $result = $this->client->get( $this->validateKeyEncoding( $key ), null, $casToken );
+ }
$result = $this->checkResult( $key, $result );
return $result;
}
public function incr( $key, $value = 1 ) {
$this->validateKeyEncoding( $key );
- return $this->client->incr( $key, $value );
+ return $this->client->incr( $key, $value ) ?? false;
}
public function decr( $key, $value = 1 ) {
$this->validateKeyEncoding( $key );
- return $this->client->decr( $key, $value );
+ return $this->client->decr( $key, $value ) ?? false;
}
}
// merge on non-existing value
$merged = $this->cache->merge( $key, $callback, 0 );
$this->assertTrue( $merged );
- $this->assertEquals( $this->cache->get( $key ), 'merged' );
+ $this->assertEquals( 'merged', $this->cache->get( $key ) );
// merge on existing value
$merged = $this->cache->merge( $key, $callback, 0 );
$this->assertTrue( $merged );
- $this->assertEquals( $this->cache->get( $key ), 'mergedmerged' );
+ $this->assertEquals( 'mergedmerged', $this->cache->get( $key ) );
/*
* Test concurrent merges by forking this process, if: