r79065 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79064‎ | r79065 | r79066 >
Date:15:36, 27 December 2010
Author:yaron
Status:deferred
Tags:
Comment:
Added check around deprecated wfLoadExtensionMessages() function, for MW 1.18+ compatibility; plus more comments
Modified paths:
  • /trunk/extensions/SemanticDrilldown/specials/SD_BrowseData.php (modified) (history)
  • /trunk/extensions/SemanticDrilldown/specials/SD_CreateFilter.php (modified) (history)
  • /trunk/extensions/SemanticDrilldown/specials/SD_Filters.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticDrilldown/specials/SD_Filters.php
@@ -14,13 +14,17 @@
1515 */
1616 function __construct() {
1717 parent::__construct( 'Filters' );
18 - wfLoadExtensionMessages( 'SemanticDrilldown' );
 18+ // Backwards compatibility for MediaWiki < 1.16
 19+ if ( function_exists( 'wfLoadExtensionMessages' ) ) {
 20+ wfLoadExtensionMessages( 'SemanticDrilldown' );
 21+ }
1922 }
2023
2124 function execute( $par ) {
2225 $this->setHeaders();
2326 list( $limit, $offset ) = wfCheckLimits();
2427 $rep = new FiltersPage();
 28+ // Handling changed in MW version 1.18.
2529 if ( method_exists( $rep, 'execute' ) ) {
2630 return $rep->execute( $par );
2731 } else {
@@ -31,6 +35,7 @@
3236
3337 class FiltersPage extends QueryPage {
3438 function __construct( $name = 'Filters' ) {
 39+ // Backwards compatibility for pre-version 1.18.
3540 if ( $this instanceof SpecialPage ) {
3641 parent::__construct( $name );
3742 }
Index: trunk/extensions/SemanticDrilldown/specials/SD_CreateFilter.php
@@ -15,7 +15,10 @@
1616 */
1717 public function SDCreateFilter() {
1818 parent::__construct( 'CreateFilter' );
19 - wfLoadExtensionMessages( 'SemanticDrilldown' );
 19+ // Backwards compatibility for MediaWiki < 1.16
 20+ if ( function_exists( 'wfLoadExtensionMessages' ) ) {
 21+ wfLoadExtensionMessages( 'SemanticDrilldown' );
 22+ }
2023 }
2124
2225 function execute( $par ) {
Index: trunk/extensions/SemanticDrilldown/specials/SD_BrowseData.php
@@ -17,7 +17,10 @@
1818 */
1919 public function __construct() {
2020 parent::__construct( 'BrowseData' );
21 - wfLoadExtensionMessages( 'SemanticDrilldown' );
 21+ // Backwards compatibility for MediaWiki < 1.16
 22+ if ( function_exists( 'wfLoadExtensionMessages' ) ) {
 23+ wfLoadExtensionMessages( 'SemanticDrilldown' );
 24+ }
2225 }
2326
2427 function execute( $query ) {
@@ -142,6 +145,7 @@
143146
144147 $wgOut->addHTML( "\n <div class=\"drilldown-results\">\n" );
145148 $rep = new SDBrowseDataPage( $category, $subcategory, $applied_filters, $remaining_filters );
 149+ // Handling changed in MW version 1.18.
146150 if ( method_exists( $rep, 'execute' ) ) {
147151 $num = $rep->execute( $query );
148152 } else {
@@ -165,6 +169,7 @@
166170 * Initialize the variables of this page
167171 */
168172 function __construct( $category, $subcategory, $applied_filters, $remaining_filters ) {
 173+ // Backwards compatibility for pre-version 1.18
169174 if ( $this instanceof SpecialPage ) {
170175 parent::__construct( 'BrowseData' );
171176 }

Status & tagging log