X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fobjectcache%2FMemcachedBagOStuff.php;h=59191d76c15fddf18ad56c6c7fc839b20c2ad18e;hb=b63ed3bd88b104cc81caa2ce9e6c2accbcc0006f;hp=87acb532ec61cfc01ac2308a71622b3ce480220b;hpb=540329ebd55e2839555ea9f631160756fa63fa45;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/objectcache/MemcachedBagOStuff.php b/includes/objectcache/MemcachedBagOStuff.php index 87acb532ec..59191d76c1 100644 --- a/includes/objectcache/MemcachedBagOStuff.php +++ b/includes/objectcache/MemcachedBagOStuff.php @@ -32,6 +32,8 @@ class MemcachedBagOStuff extends BagOStuff { /** * Fill in the defaults for any parameters missing from $params, using the * backwards-compatible global variables + * @param array $params + * @return array */ protected function applyDefaultParams( $params ) { if ( !isset( $params['servers'] ) ) { @@ -56,18 +58,18 @@ class MemcachedBagOStuff extends BagOStuff { } /** - * @param $key string - * @param $casToken[optional] mixed - * @return Mixed + * @param string $key + * @param mixed $casToken [optional] + * @return mixed */ public function get( $key, &$casToken = null ) { return $this->client->get( $this->encodeKey( $key ), $casToken ); } /** - * @param $key string - * @param $value - * @param $exptime int + * @param string $key + * @param mixed $value + * @param int $exptime * @return bool */ public function set( $key, $value, $exptime = 0 ) { @@ -76,10 +78,10 @@ class MemcachedBagOStuff extends BagOStuff { } /** - * @param $key string - * @param $casToken mixed - * @param $value - * @param $exptime int + * @param mixed $casToken + * @param string $key + * @param mixed $value + * @param int $exptime * @return bool */ public function cas( $casToken, $key, $value, $exptime = 0 ) { @@ -88,8 +90,8 @@ class MemcachedBagOStuff extends BagOStuff { } /** - * @param $key string - * @param $time int + * @param string $key + * @param int $time * @return bool */ public function delete( $key, $time = 0 ) { @@ -97,10 +99,10 @@ class MemcachedBagOStuff extends BagOStuff { } /** - * @param $key string - * @param $value int + * @param string $key + * @param int $value * @param int $exptime (default 0) - * @return Mixed + * @return mixed */ public function add( $key, $value, $exptime = 0 ) { return $this->client->add( $this->encodeKey( $key ), $value, @@ -110,6 +112,7 @@ class MemcachedBagOStuff extends BagOStuff { /** * Get the underlying client object. This is provided for debugging * purposes. + * @return BagOStuff */ public function getClient() { return $this->client; @@ -122,7 +125,7 @@ class MemcachedBagOStuff extends BagOStuff { * the other control characters for compatibility with libmemcached * verify_key. We leave other punctuation alone, to maximise backwards * compatibility. - * @param $key string + * @param string $key * @return string */ public function encodeKey( $key ) { @@ -131,7 +134,7 @@ class MemcachedBagOStuff extends BagOStuff { } /** - * @param $m array + * @param array $m * @return string */ protected function encodeKeyCallback( $m ) { @@ -144,6 +147,8 @@ class MemcachedBagOStuff extends BagOStuff { * discarded immediately because the expiry is in the past. * Clamp expiries >30d at 30d, unless they're >=1e9 in which * case they are likely to really be absolute (1e9 = 2011-09-09) + * @param int $expiry + * @return int */ function fixExpiry( $expiry ) { if ( $expiry > 2592000 && $expiry < 1000000000 ) { @@ -156,7 +161,7 @@ class MemcachedBagOStuff extends BagOStuff { * Decode a key encoded with encodeKey(). This is provided as a convenience * function for debugging. * - * @param $key string + * @param string $key * * @return string */ @@ -166,11 +171,9 @@ class MemcachedBagOStuff extends BagOStuff { /** * Send a debug message to the log + * @param string $text */ protected function debugLog( $text ) { - if ( substr( $text, -1 ) !== "\n" ) { - $text .= "\n"; - } wfDebugLog( 'memcached', $text ); } }