TemplateParser: Remove support for deprecated cache-disabling parameter

Passing EmptyBagOStuff will still have same effect, but the deprecated
way of specifying so with boolean is now removed.

Change-Id: I8ec0f54e94b71af9256813f333e615bca1bb8444
This commit is contained in:
Ammarpad 2021-09-12 19:39:19 +01:00 committed by Krinkle
parent 5bdce46006
commit 1b203d0558
2 changed files with 5 additions and 7 deletions

View file

@ -79,8 +79,11 @@ because of Phabricator reports.
* MessageCache::singleton(), deprecated since 1.34, has been removed.
* FileBackendGroup::singleton() and ::destroySingletons(), both deprecated since
1.35, have been removed.
* TemplateParser used to support disabling the cache with a boolean parameter
in its constructor. This was deprecated in 1.35 and has now been removed.
* The signature of PageUpdater::markAsRevert method was changed. It has never
been used outside of MediaWiki core.
* …
=== Deprecations in 1.38 ===
* …

View file

@ -51,15 +51,10 @@ class TemplateParser {
/**
* @param string|null $templateDir
* @param BagOStuff|null|true $cache Read-write cache
* If set to true, caching is disabled (deprecated since 1.35).
* @param BagOStuff|null $cache Read-write cache
*/
public function __construct( $templateDir = null, $cache = null ) {
public function __construct( $templateDir = null, ?BagOStuff $cache = null ) {
$this->templateDir = $templateDir ?: __DIR__ . '/templates';
if ( $cache === true ) {
wfDeprecated( __CLASS__ . ' with $forceRecompile', '1.35' );
$cache = new EmptyBagOStuff();
}
$this->cache = $cache ?: ObjectCache::getLocalServerInstance( CACHE_ANYTHING );
// Do not add more flags here without discussion.