From: Aaron Schulz Date: Sat, 28 Dec 2013 08:58:41 +0000 (-0800) Subject: Added $purgeBlobs flag to LocalisationCacheRecache hook X-Git-Tag: 1.31.0-rc.0~17451 X-Git-Url: http://git.cyclocoop.org//%22%22.str_replace%28%27%22%27%2C?a=commitdiff_plain;h=7bd3a8c576f73c9ca4f8a49c139fdf0a136ab720;p=lhc%2Fweb%2Fwiklou.git Added $purgeBlobs flag to LocalisationCacheRecache hook * This helps replace the WMF live hack to skip calling clear() Change-Id: I37bd6cf87e72b6d32e4c6c261abe2a0ef43d067e --- 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(); }