Ensure all key transformations are applied by BagOStuff::makeKeyInternal()
authorOri Livneh <ori@wikimedia.org>
Sat, 24 Oct 2015 00:53:25 +0000 (17:53 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Sat, 24 Oct 2015 01:46:04 +0000 (18:46 -0700)
commitcdb543272883b18000c6a522c6526fa7d72f4c1c
treeedb80f13722f70ff79373474eeaefe2c5c90fca9
parentc8504fc8359317221c306bd2d74feefeecaca91c
Ensure all key transformations are applied by BagOStuff::makeKeyInternal()

Currently we have to undo any transformations we apply to keys in getMulti() by
iterating over the response array keys reversing any changes. This is hairy and
complicated. So --

* Replace calls to MemcachedBagOStuff::encodeKey() with calls to a new method,
  MemcachedBagOStuff::validateKeyEncoding(). The new method only validates that
  the key is compatible with memcached. If it is not, it throws an exception.
  If it is, it returns the key unmodified.

* Remove MemcachedBagOStuff::{encode,decode}Key(), since they no longer serve a
  purpose, and have no callers.

Change-Id: If3e20c6a1a1b42fc1f2823aa660328e37c26eccb
includes/objectcache/MemcachedBagOStuff.php
includes/objectcache/MemcachedPeclBagOStuff.php
tests/phpunit/includes/objectcache/MemcachedBagOStuffTest.php