r84239 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84238‎ | r84239 | r84240 >
Date:13:50, 18 March 2011
Author:reedy
Status:ok
Tags:
Comment:
Remove some old codepaths

Kill unused globals
Modified paths:
  • /trunk/extensions/CategoryTree/CategoryTree.php (modified) (history)
  • /trunk/extensions/Crosswiki/Block/CrosswikiBlock.page.php (modified) (history)
  • /trunk/extensions/Deployment/specials/SpecialUpdate.php (modified) (history)
  • /trunk/extensions/FCKeditor/FCKeditorParser.body.php (modified) (history)
  • /trunk/extensions/GetFamily/GetFamily.php (modified) (history)
  • /trunk/extensions/GoogleMaps/GoogleMaps.body.php (modified) (history)
  • /trunk/extensions/HeaderTabs/HeaderTabs_body.jq.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php (modified) (history)
  • /trunk/extensions/News/NewsRenderer.php (modified) (history)
  • /trunk/extensions/RecordAdmin/SpecialRecordAdmin.php (modified) (history)
  • /trunk/extensions/SimpleSecurity/SimpleSecurity.php (modified) (history)
  • /trunk/extensions/WikiArticleFeeds/WikiArticleFeeds.php (modified) (history)

Diff [purge]

Index: trunk/extensions/WikiArticleFeeds/WikiArticleFeeds.php
@@ -414,7 +414,7 @@
415415 * @param Array $filterTags Tags to use in filtering out items.
416416 */
417417 function wfGenerateWikiFeed( $article, $feedFormat = 'atom', $filterTags = null ) {
418 - global $wgOut, $wgScript, $wgServer, $wgFeedClasses, $wgVersion, $wgSitename;
 418+ global $wgOut, $wgServer, $wgFeedClasses, $wgVersion, $wgSitename;
419419
420420 # Setup, handle redirects
421421 if ( $article->isRedirect() ) {
Index: trunk/extensions/HeaderTabs/HeaderTabs_body.jq.php
@@ -17,8 +17,6 @@
1818 }
1919
2020 public static function replaceFirstLevelHeaders( &$parser, &$text ) {
21 - global $htUseHistory, $wgVersion;
22 -
2321 $aboveandbelow = explode( '<div id="nomoretabs"></div>', $text, 2 );
2422
2523 if ( count( $aboveandbelow ) <= 1 ) {
Index: trunk/extensions/GoogleMaps/GoogleMaps.body.php
@@ -553,7 +553,7 @@
554554
555555 static function addMarker(&$pExporter, &$pParser, &$pLocalParser, $pLat, $pLon,
556556 $pIcon, $pTitle, $pTabs, $pCaption, $pLineColorSet) {
557 - global $wgUser, $wgVersion;
 557+ global $wgUser;
558558 $parsed = self::parseWikiText($pParser, $pLocalParser, preg_replace('/\r\n/', '<br />', $pCaption), $pParser->mTitle, $pParser->mOptions);
559559 $title = Title::newFromText($pTitle);
560560 $revision = is_null($title) ? null :
Index: trunk/extensions/Deployment/specials/SpecialUpdate.php
@@ -85,7 +85,7 @@
8686 * @param $status Mixed: false when there are no updates or a version number (string) when there is.
8787 */
8888 protected function showCoreStatus( $status ) {
89 - global $wgOut, $wgVersion;
 89+ global $wgOut;
9090
9191 if ( $status === false ) {
9292 $wgOut->addHTML( '<h3>' . wfMsg( 'mediawiki-up-to-date' ) . '</h3>' );
Index: trunk/extensions/GetFamily/GetFamily.php
@@ -40,7 +40,7 @@
4141 // FIXME: split off into GetFamily_body.php
4242 function wfSpecialGetFamily() {
4343 global $wgRequest, $wgLanguageNames;
44 - global $wgScript, $wgDBname, $wgLanguageCode, $wgSitename, $wgServer, $wgArticlePath, $wgCanonicalNamespaceNames, $wgVersion;
 44+ global $wgScript, $wgDBname, $wgLanguageCode, $wgSitename, $wgServer, $wgArticlePath, $wgVersion;
4545
4646 $out = '';
4747
Index: trunk/extensions/SimpleSecurity/SimpleSecurity.php
@@ -21,7 +21,6 @@
2222 */
2323
2424 if ( !defined( 'MEDIAWIKI' ) ) die( 'Not an entry point.' );
25 -if ( version_compare( $wgVersion, '1.12.0' ) < 0 ) die( 'Sorry, this extension requires at least MediaWiki version 1.12.0' );
2625
2726 define( 'SIMPLESECURITY_VERSION', '4.5.1, 2010-10-16' );
2827
Index: trunk/extensions/RecordAdmin/SpecialRecordAdmin.php
@@ -31,7 +31,7 @@
3232 }
3333
3434 function execute( $param ) {
35 - global $wgVersion, $wgOut, $wgRequest, $wgLang, $wgRecordAdmin, $wgSecurityProtectRecords;
 35+ global $wgOut, $wgRequest, $wgRecordAdmin, $wgSecurityProtectRecords;
3636 if ( !isset( $wgSecurityProtectRecords ) ) $wgSecurityProtectRecords = false;
3737
3838 $this->setHeaders();
Index: trunk/extensions/News/NewsRenderer.php
@@ -553,8 +553,6 @@
554554 }
555555
556556 static function replaceVariables($parser, $text, $params = null, $title = null) {
557 - global $wgVersion;
558 -
559557 if ( $params === null ) $params = array();
560558 $text = $parser->replaceVariables( $text, $params );
561559 return $text;
Index: trunk/extensions/Crosswiki/Block/CrosswikiBlock.page.php
@@ -23,8 +23,7 @@
2424 * @param mixed $par Parameter passed to the page
2525 */
2626 public function execute( $par ) {
27 - global $wgOut, $wgUser, $wgRequest, $wgContLang, $wgLang;
28 - global $wgVersion, $wgMaxNameChars, $wgCapitalLinks;
 27+ global $wgOut, $wgUser, $wgRequest;
2928
3029 # Add messages
3130 wfLoadExtensionMessages( 'CrosswikiBlock' );
Index: trunk/extensions/CategoryTree/CategoryTree.php
@@ -67,7 +67,7 @@
6868
6969 $wgCategoryTreeExtPath = '/extensions/CategoryTree';
7070 $wgCategoryTreeVersion = '6'; # NOTE: bump this when you change the CSS or JS files!
71 -$wgCategoryTreeUseCategoryTable = version_compare( $wgVersion, "1.13", '>=' );
 71+$wgCategoryTreeUseCategoryTable = true;
7272
7373 $wgCategoryTreeOmitNamespace = CT_HIDEPREFIX_CATEGORIES;
7474 $wgCategoryTreeDefaultMode = CT_MODE_CATEGORIES;
Index: trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php
@@ -201,13 +201,8 @@
202202 }
203203 }
204204
205 - if (version_compare($wgVersion,'1.13','>=')) {
206 - $wgHooks['SkinTemplateToolboxEnd'][] = 'mvAddToolBoxLinks'; // introduced only in 1.13
207 - } else {
208 - $wgHooks['MonoBookTemplateToolboxEnd'][] = 'mvAddToolBoxLinks';
209 - }
 205+ $wgHooks['SkinTemplateToolboxEnd'][] = 'mvAddToolBoxLinks'; // introduced only in 1.13
210206
211 -
212207 // @@NOTE this hook is not avaliable by default in medaiwiki
213208 // to use this hook you should add this function to moveTo()
214209 // right after the local check in Title.php:
Index: trunk/extensions/FCKeditor/FCKeditorParser.body.php
@@ -180,11 +180,7 @@
181181
182182 $elements = array_unique( $elements );
183183 $matches = array();
184 - if( version_compare( "1.12", $wgVersion, ">" ) ) {
185 - $text = Parser::extractTagsAndParams( $elements, $text, $matches, $uniq_prefix );
186 - } else {
187 - $text = self::extractTagsAndParams( $elements, $text, $matches, $uniq_prefix );
188 - }
 184+ $text = Parser::extractTagsAndParams( $elements, $text, $matches, $uniq_prefix );
189185
190186 foreach( $matches as $marker => $data ) {
191187 list( $element, $content, $params, $tag ) = $data;

Status & tagging log