resourceloader: Improve titleInfo docs and simplify title key
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 10 Apr 2018 17:29:50 +0000 (18:29 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Tue, 10 Apr 2018 18:44:40 +0000 (19:44 +0100)
commitdfb754cbc633b7b653ae94bf9d64a88d6adad7c7
tree230ee02a77b1c81603efc88f623485afbc5c192f
parent045e6b87383bed5551bdc3d205b7813b69ea64a5
resourceloader: Improve titleInfo docs and simplify title key

* Document the structure of the in-process $titleInfo cache.
  Specifically, specify that it is not the value from getTitleInfo(),
  but rather a container for zero or more versions of such values.
  The reason this is fragmented is because ResourceLoaderContext
  is a parameter to most methods and as such, makes everything
  variable. Tracked as T99107.

* Make various bits easier to understand by consistently refering
  to the container keys as "batchKey", and referring to the internal
  keys as "titleKey".

* Centralise title key logic by moving to private method.

* Replace the internal creation of titleKey to be based on LinkTarget
  with plain namespace IDs and db keys, instead of invoking the
  expensive getPrefixedTitle function which involves quite a lot
  of overhead (TitleCodec, GenderCache, Database, Language,
  LocalisationCache, ..).

Change-Id: I701e5156ef7815a0e36caefae5871524eff3f688
includes/resourceloader/ResourceLoaderWikiModule.php
tests/phpunit/includes/resourceloader/ResourceLoaderWikiModuleTest.php