User: Migrate from foreign cache to global cache for UserRightsProxy
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 27 Oct 2015 23:43:40 +0000 (23:43 +0000)
committerTimo Tijhof <krinklemail@gmail.com>
Mon, 2 Nov 2015 21:39:46 +0000 (21:39 +0000)
commitb3acd4fb5d1263de5735c714a11f7a170777d1f1
tree47d5c8e101d8d4f0273cbb70e59c6396b28b443d
parent993c25c980d0985510228632d526b582ba52c366
User: Migrate from foreign cache to global cache for UserRightsProxy

Avoid having one wiki access another wiki's local keyspace.
Instead, use the global keyspace to share values across wikis.

Also, imitating wfMemcKey from wfForeignMemcKey was semantically
incorrect due to $wgCachePrefix having precedence. Most interfaces
(e.g. UserRightsProxy, FileRepo, JobQueue etc.) only have access
to the wiki id (dbname + prefix). The local cache configuration
for wgCachePrefix is not and shouldn't have to be exposed.

Start enforcing that local cache keys are left private and
to share keys, one must use global keys.

Global keys (prefixed with "global:") have their own space and we
can use the wiki-id as regular key segment for keys about users.

Also:
* Expose a method to keep formatting of this key in one place.
  As it used used in many different places in core, as well
  as in CentralAuth.
* Make use of wfWikiId() in getDefaultKeyspace() to avoid
  duplicating this logic.

Change-Id: I58836a24b9e239f460ab489bd2fe8ced8259833c
includes/User.php
includes/UserRightsProxy.php
includes/objectcache/ObjectCache.php