summaryrefslogtreecommitdiff
path: root/includes/objectcache/MemcachedBagOStuff.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
committerPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
commit08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 (patch)
tree577a29fb579188d16003a209ce2a2e9c5b0aa2bd /includes/objectcache/MemcachedBagOStuff.php
parentcacc939b34e315b85e2d72997811eb6677996cc1 (diff)
Update to MediaWiki 1.21.1
Diffstat (limited to 'includes/objectcache/MemcachedBagOStuff.php')
-rw-r--r--includes/objectcache/MemcachedBagOStuff.php27
1 files changed, 17 insertions, 10 deletions
diff --git a/includes/objectcache/MemcachedBagOStuff.php b/includes/objectcache/MemcachedBagOStuff.php
index 813c2727..3f1fa3a0 100644
--- a/includes/objectcache/MemcachedBagOStuff.php
+++ b/includes/objectcache/MemcachedBagOStuff.php
@@ -57,10 +57,11 @@ class MemcachedBagOStuff extends BagOStuff {
/**
* @param $key string
+ * @param $casToken[optional] mixed
* @return Mixed
*/
- public function get( $key ) {
- return $this->client->get( $this->encodeKey( $key ) );
+ public function get( $key, &$casToken = null ) {
+ return $this->client->get( $this->encodeKey( $key ), $casToken );
}
/**
@@ -76,6 +77,18 @@ class MemcachedBagOStuff extends BagOStuff {
/**
* @param $key string
+ * @param $casToken mixed
+ * @param $value
+ * @param $exptime int
+ * @return bool
+ */
+ public function cas( $casToken, $key, $value, $exptime = 0 ) {
+ return $this->client->cas( $casToken, $this->encodeKey( $key ),
+ $value, $this->fixExpiry( $exptime ) );
+ }
+
+ /**
+ * @param $key string
* @param $time int
* @return bool
*/
@@ -86,7 +99,7 @@ class MemcachedBagOStuff extends BagOStuff {
/**
* @param $key string
* @param $value int
- * @param $exptime int (default 0)
+ * @param int $exptime (default 0)
* @return Mixed
*/
public function add( $key, $value, $exptime = 0 ) {
@@ -101,7 +114,7 @@ class MemcachedBagOStuff extends BagOStuff {
* @return Mixed
*/
public function replace( $key, $value, $exptime = 0 ) {
- return $this->client->replace( $this->encodeKey( $key ), $value,
+ return $this->client->replace( $this->encodeKey( $key ), $value,
$this->fixExpiry( $exptime ) );
}
@@ -166,15 +179,9 @@ class MemcachedBagOStuff extends BagOStuff {
* Send a debug message to the log
*/
protected function debugLog( $text ) {
- global $wgDebugLogGroups;
- if( !isset( $wgDebugLogGroups['memcached'] ) ) {
- # Prefix message since it will end up in main debug log file
- $text = "memcached: $text";
- }
if ( substr( $text, -1 ) !== "\n" ) {
$text .= "\n";
}
wfDebugLog( 'memcached', $text );
}
}
-