objectcache: make getMultiWith(Union)SetCallback() usage easier
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 12 Jul 2019 22:48:25 +0000 (15:48 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Sun, 14 Jul 2019 14:51:51 +0000 (14:51 +0000)
commit12f4ce87e9c232d809e33a28e02c7faa5188723a
tree7a1e6d9f63192ecc3840f041ff74a06f25a89d4b
parentdd49c0c312043062e919549390ca46595b01bbb0
objectcache: make getMultiWith(Union)SetCallback() usage easier

Add WANObjectCache::multiRemap() as an array_combine() wrapper for
easily working with IDs after getMultiWith(Union)SetCallback() calls.
Make the enforcement of uniqueness in makeMultiKeys() stricter and
discourage poor key design in comments. Add WANObjectCache::hash256()
method for getting good key component hashes.

Also avoid pointless use of ArrayIterator::getArrayCopy().

Change-Id: I61ffdbf4af4374864bac180df590b4dddc8da56b
includes/libs/objectcache/WANObjectCache.php
includes/objectcache/ObjectCache.php
tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php