Revision: Simplify loadText() with nested getWithSetCallback
authorTimo Tijhof <krinklemail@gmail.com>
Wed, 7 Sep 2016 01:34:43 +0000 (18:34 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 7 Sep 2016 18:44:04 +0000 (18:44 +0000)
commitaa0f6ead348d0aa3f59d51df0806e95eb76babf8
tree5271b4b7c909da28ef9539cac2cf764de174fd91
parentd1f09fb4c3bc43261c5b8449c83f1826410cd3e7
Revision: Simplify loadText() with nested getWithSetCallback

The logic was a bit hard to follow as there were two layers of
caching and a conditional (expiry being set).

* Move fetch logic for revision text to a private method.
* Call directly when cache is disabled.
* Simplify cache has/get/set by using getWithSetCallback.

Change-Id: Icd74cd8e944266c20dc7c5cb25f56300636dce1e
includes/Revision.php
includes/libs/MapCacheLRU.php