Merge "Correct case of Title::getPrefixedDBkey() calls"
[lhc/web/wiklou.git] / includes / objectcache / MemcachedBagOStuff.php
index 643d2e9..3f1fa3a 100644 (file)
@@ -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 );
        }
 
        /**
@@ -74,6 +75,18 @@ class MemcachedBagOStuff extends BagOStuff {
                        $this->fixExpiry( $exptime ) );
        }
 
+       /**
+        * @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
@@ -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 ) {
@@ -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 );
        }
 }
-