From 7bd3a8c576f73c9ca4f8a49c139fdf0a136ab720 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sat, 28 Dec 2013 00:58:41 -0800 Subject: [PATCH] Added $purgeBlobs flag to LocalisationCacheRecache hook * This helps replace the WMF live hack to skip calling clear() Change-Id: I37bd6cf87e72b6d32e4c6c261abe2a0ef43d067e --- docs/hooks.txt | 1 + includes/cache/LocalisationCache.php | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index ebc412b655..fc4d40e3ae 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1546,6 +1546,7 @@ 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() 'LocalisationChecksBlacklist': When fetching the blacklist of localisation checks. diff --git a/includes/cache/LocalisationCache.php b/includes/cache/LocalisationCache.php index 55c4c58185..47a5904d08 100644 --- a/includes/cache/LocalisationCache.php +++ b/includes/cache/LocalisationCache.php @@ -923,7 +923,8 @@ class LocalisationCache { $allData['list'][$key] = array_keys( $allData[$key] ); } # Run hooks - wfRunHooks( 'LocalisationCacheRecache', array( $this, $code, &$allData ) ); + $purgeBlobs = true; + wfRunHooks( 'LocalisationCacheRecache', array( $this, $code, &$allData, &$purgeBlobs ) ); if ( is_null( $allData['namespaceNames'] ) ) { wfProfileOut( __METHOD__ ); @@ -958,7 +959,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 ( !$this->store instanceof LCStoreNull ) { + if ( $purgeBlobs && !$this->store instanceof LCStoreNull ) { MessageBlobStore::clear(); } -- 2.20.1