ApiParse: Clean up parsing code
authorBrad Jorsch <bjorsch@wikimedia.org>
Mon, 12 Jun 2017 15:02:58 +0000 (11:02 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Mon, 12 Jun 2017 16:34:17 +0000 (12:34 -0400)
commit1e2b3fb37f3452ee9037f6efff24d86275308e7b
treea25bc2314b2c66c0ddd7d610bbc9f49760480bab
parente16191caa3afa2a1d97b6f3436092daa7157f8ae
ApiParse: Clean up parsing code

Now that ParserOptions->isSafeToCache() exists, use it where necessary.
This also moves the use inside the makeParserOptions() method so other
callers can pick it up as well.

Then pass the flag as $forceParse into WikiPage::getParserOutput()
instead of duplicating the logic in several cases, and generally clean
up the logic in the module to let WikiPage decide when to use the cache
in more cases.

Change-Id: I0079e10a40997e4a3b59ac21ef6c92246a147736
includes/api/ApiParse.php
tests/phpunit/includes/api/ApiParseTest.php