Added $purgeBlobs flag to LocalisationCacheRecache hook

* This helps replace the WMF live hack to skip calling clear()

Change-Id: I37bd6cf87e72b6d32e4c6c261abe2a0ef43d067e
This commit is contained in:
Aaron Schulz 2013-12-28 00:58:41 -08:00 committed by Reedy
parent 247b8ede25
commit 7bd3a8c576
2 changed files with 4 additions and 2 deletions

View file

@ -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.

View file

@ -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();
}