Skin: Use WANObjectCache for sitenotice caching
authorTimo Tijhof <krinklemail@gmail.com>
Sat, 1 Jul 2017 04:19:31 +0000 (21:19 -0700)
committerKrinkle <krinklemail@gmail.com>
Mon, 3 Jul 2017 22:04:15 +0000 (22:04 +0000)
commit83b50484e0023ec16f24f65c29009dcb2e7b5fd5
tree1a7b19a6c31a83b0e8660cb133c8dc80d6b1327a
parentc47221ab8246b0428628500cfe0fdcd11f96bcf3
Skin: Use WANObjectCache for sitenotice caching

* Move the md5() hash to the cache key, this makes it much safer
  after a change happens by avoiding write competitions between different
  servers and db slaves. It also allows an undo to re-use the existing
  cache if it still exists.

  In addition, it enables idiomatic use of getWithSetCallback given
  that get and set are now logically separated.

* Avoid fragile re-use of variable names. Previously it read the
  original $notice value at multiple points but also setting $notice
  to $parsed after a certain point. Consistently use $parsed only.

(Ref T115890.)

Change-Id: I5488cc894ff1544e6c20b7d51a7a2adfc292c4ec
includes/skins/Skin.php