From: Roan Kattouw Date: Mon, 15 Jul 2019 22:30:15 +0000 (-0700) Subject: Remove $purgeBlobs parameter from LocalisationCacheRecache hook X-Git-Tag: 1.34.0-rc.0~990^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22auteur_infos%22%2C%22id_auteur=%24connect_id_auteur%22%29%20.%20%22?a=commitdiff_plain;h=cac26b713c5cdebd23d87355067b0d394bfa2fa5;p=lhc%2Fweb%2Fwiklou.git Remove $purgeBlobs parameter from LocalisationCacheRecache hook No longer allow hook functions to prevent message blobs from being purged. Pass in an always-true variable for backwards compatibility, which is then ignored. Change-Id: I27ac9599711f2f0df2514a3934270af0ce03da7f --- diff --git a/RELEASE-NOTES-1.34 b/RELEASE-NOTES-1.34 index ea46a7d3a8..24809dd4ac 100644 --- a/RELEASE-NOTES-1.34 +++ b/RELEASE-NOTES-1.34 @@ -362,6 +362,8 @@ because of Phabricator reports. been deprecated. * User::getRights() and User::$mRights have been deprecated. Use PermissionManager::getUserPermissions() instead. +* The LocalisationCacheRecache hook no longer allows purging of message blobs + to be prevented. Modifying the $purgeBlobs parameter now has no effect. === Other changes in 1.34 === * … diff --git a/docs/hooks.txt b/docs/hooks.txt index 80453f48c6..3edd10d759 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -2087,8 +2087,6 @@ cache. $cache: The LocalisationCache object $code: language code &$alldata: The localisation data from core and extensions -&$purgeBlobs: whether to purge/update the message blobs via - MessageBlobStore::clear() 'LocalisationCacheRecacheFallback': Called for each language when merging fallback data into the cache. diff --git a/includes/cache/localisation/LocalisationCache.php b/includes/cache/localisation/LocalisationCache.php index c4a7e897c4..a0f3d8e28c 100644 --- a/includes/cache/localisation/LocalisationCache.php +++ b/includes/cache/localisation/LocalisationCache.php @@ -1004,8 +1004,8 @@ class LocalisationCache { $allData['list'][$key] = array_keys( $allData[$key] ); } # Run hooks - $purgeBlobs = true; - Hooks::run( 'LocalisationCacheRecache', [ $this, $code, &$allData, &$purgeBlobs ] ); + $unused = true; // Used to be $purgeBlobs, removed in 1.34 + Hooks::run( 'LocalisationCacheRecache', [ $this, $code, &$allData, &$unused ] ); if ( is_null( $allData['namespaceNames'] ) ) { throw new MWException( __METHOD__ . ': Localisation data failed sanity check! ' . @@ -1037,7 +1037,7 @@ class LocalisationCache { # Clear out the MessageBlobStore # HACK: If using a null (i.e. disabled) storage backend, we # can't write to the MessageBlobStore either - if ( $purgeBlobs && !$this->store instanceof LCStoreNull ) { + if ( !$this->store instanceof LCStoreNull ) { $blobStore = MediaWikiServices::getInstance()->getResourceLoader()->getMessageBlobStore(); $blobStore->clear(); }