Merge "Split classes in Import.php into separate files"
[lhc/web/wiklou.git] / includes / libs / objectcache / MemcachedBagOStuff.php
index 749c6d3..7a36214 100644 (file)
  * @ingroup Cache
  */
 class MemcachedBagOStuff extends BagOStuff {
-       /** @var MWMemcached|Memcached */
+       /** @var MemcachedClient|Memcached */
        protected $client;
 
        /**
-        * Fill in the defaults for any parameters missing from $params, using the
-        * backwards-compatible global variables
+        * Fill in some defaults for missing keys in $params.
+        *
         * @param array $params
         * @return array
         */
@@ -86,7 +86,7 @@ class MemcachedBagOStuff extends BagOStuff {
        /**
         * Get the underlying client object. This is provided for debugging
         * purposes.
-        * @return BagOStuff
+        * @return MemcachedClient|Memcached
         */
        public function getClient() {
                return $this->client;
@@ -103,8 +103,9 @@ class MemcachedBagOStuff extends BagOStuff {
        public function makeKeyInternal( $keyspace, $args ) {
                // Memcached keys have a maximum length of 255 characters. From that,
                // subtract the number of characters we need for the keyspace and for
-               // the separator character needed for each argument.
-               $charsLeft = 255 - strlen( $keyspace ) - count( $args );
+               // the separator character needed for each argument. To handle some
+               // custom prefixes used by thing like WANObjectCache, limit to 205.
+               $charsLeft = 205 - strlen( $keyspace ) - count( $args );
 
                $args = array_map(
                        function ( $arg ) use ( &$charsLeft ) {