Use RejectParserCacheValue hook to invalidate caches that were using GeSHi

Change-Id: I47de88dc1c2f2380e41e6af0d3222b46c9c65569
This commit is contained in:
Kunal Mehta 2015-06-23 13:46:35 -07:00 committed by Ori.livneh
parent 139f68c410
commit 01802ac3fb
2 changed files with 21 additions and 0 deletions

View file

@ -378,6 +378,24 @@ class SyntaxHighlight_GeSHi {
return false;
}
/**
* Reject parser cache values that are for GeSHi since those
* ResourceLoader modules no longer exist
*
* @param ParserOutput $parserOutput
* @param WikiPage $page
* @param ParserOptions $popts
* @return bool
*/
public static function onRejectParserCacheValue( ParserOutput $parserOutput, WikiPage $page, ParserOptions $popts ) {
foreach ( $parserOutput->getModuleStyles() as $module ) {
if ( strpos( $module, 'ext.geshi.' ) === 0 ) {
return false;
}
}
return true;
}
/** Backward-compatibility shim for extensions. */
public static function prepare( $text, $lang ) {
wfDeprecated( __METHOD__ );

View file

@ -50,6 +50,9 @@
],
"ApiFormatHighlight": [
"SyntaxHighlight_GeSHi::onApiFormatHighlight"
],
"RejectParserCacheValue": [
"SyntaxHighlight_GeSHi::onRejectParserCacheValue"
]
},
"SyntaxHighlightModels": {