Remove $purgeBlobs parameter from LocalisationCacheRecache hook
authorRoan Kattouw <roan.kattouw@gmail.com>
Mon, 15 Jul 2019 22:30:15 +0000 (15:30 -0700)
committerRoan Kattouw <roan.kattouw@gmail.com>
Mon, 15 Jul 2019 22:32:03 +0000 (15:32 -0700)
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

RELEASE-NOTES-1.34
docs/hooks.txt
includes/cache/localisation/LocalisationCache.php

index ea46a7d..24809dd 100644 (file)
@@ -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 ===
 * …
index 80453f4..3edd10d 100644 (file)
@@ -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.
index c4a7e89..a0f3d8e 100644 (file)
@@ -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();
                }