Remove ParserOptions::legacyOptions() and cleanup related code
authorBrad Jorsch <bjorsch@wikimedia.org>
Wed, 21 Jun 2017 16:21:45 +0000 (12:21 -0400)
committerTim Starling <tstarling@wikimedia.org>
Tue, 4 Jul 2017 01:28:57 +0000 (01:28 +0000)
commit84694a9d592ee5f93e41a5e7dc06eaa40c669c0c
treecd49b57045573ab50487abe116f525877b42da18
parent2ad6c070b8c4df374ea1a884e34f6a4e8aa9c666
Remove ParserOptions::legacyOptions() and cleanup related code

ParserOptions::legacyOptions() has been sitting around since 1.17.
Originally it seems to have been intended as a way to avoid a mass cache
invalidation (similar to optionsHashPre30() from I7fb9ffca9). That code
was mostly removed in 1.23, but legacyOptions() was left behind because
it was also being used in a few places as "all cache-varying options"
(despite it not being documented for that purpose) where we'd rather
have any key than no key at all.

This patch creates an actual ParserOptions::allCacheVaryingOptions()
method for those use cases and deprecates the long-obsolete
legacyOptions().

It also makes more explicit the use of the "all cache-varying options"
fallback in ParserCache::getKey(), and doesn't bother trying to use that
fallback in ParserCache::get() where it no longer makes sense.

Change-Id: Ife1e54744155136a570210c03fe907f18f8e8ece
includes/parser/ParserCache.php
includes/parser/ParserOptions.php
tests/phpunit/includes/parser/ParserOptionsTest.php