* @throws MWException
*/
public function __construct( $title, $action ) {
+ parent::__construct();
$allowedTypes = self::cacheablePageActions();
if ( !in_array( $action, $allowedTypes ) ) {
throw new MWException( 'Invalid file cache type given.' );
$clang = $wgContLang->getCode();
// Check that there are no other sources of variation
- return !$user->getId() && !$user->getNewtalk() && $ulang == $clang;
+ if ( $user->getId() || $user->getNewtalk() || $ulang != $clang ) {
+ return false;
+ }
+ // Allow extensions to disable caching
+ return Hooks::run( 'HTMLFileCache::useFileCache', array( $context ) );
}
/**