From 239705928db3e17402e84bc459204e6372c3501a Mon Sep 17 00:00:00 2001 From: Sam Smith Date: Tue, 10 Nov 2015 17:03:06 +0000 Subject: [PATCH] Remove CustomData extension dependency The related pages stored via CustomData will have been migrated to the cached ParserOutput class over the last 30 days, per I30bd17f, so all interactions with/references to CustomData can be removed. Bug: T115019 Change-Id: I36919d2443f0ee02ac6baf9a4d2228b028b2e6ed --- includes/Hooks.php | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/includes/Hooks.php b/includes/Hooks.php index c83c95a6..714df5a4 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -3,8 +3,6 @@ namespace RelatedArticles; use Parser; -// FIXME: Remove in 30 days (T114915) -use CustomData; use Exception; use Title; use SkinTemplate; @@ -84,36 +82,12 @@ class Hooks { return true; } - - /** - * Gets the global instance of the {@see CustomData} class for backwards compatibility. - * - * FIXME: This can be removed when cache clears. (T114915) - * If the instance isn't available, then an exception is thrown. - * - * @throws Exception When the CustomData extension isn't properly installed - * @deprecated - * @return CustomData - */ - public static function getCustomData() { - global $wgCustomData; - - if ( !$wgCustomData instanceof CustomData ) { - throw new Exception( - 'CustomData extension isn\'t properly installed and is needed to view pages in cache.' - ); - } - - return $wgCustomData; - } - /** * Passes the related articles list from the cached parser output * object to the output page for rendering. * * The list of related articles will be retrieved using - * ParserOutput#getExtensionData and, if that fails, - * CustomData#getParserData. + * ParserOutput#getExtensionData. * * @param OutputPage $out * @param ParserOutput $parserOutput @@ -121,12 +95,6 @@ class Hooks { */ public static function onOutputPageParserOutput( OutputPage &$out, ParserOutput $parserOutput ) { $related = $parserOutput->getExtensionData( 'RelatedArticles' ); - // Backwards compatability with old cached pages. In cached pages, related articles will not be in - // ParserOutput but will still be in custom data so let's retrieve them from there. - // FIXME: Remove in 30 days (T114915) - if ( !$related ) { - $related = self::getCustomData()->getParserData( $out, 'RelatedArticles' ); - } if ( $related ) { $out->setProperty( 'RelatedArticles', $related );