r111503 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111502‎ | r111503 | r111504 >
Date:22:42, 14 February 2012
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Why are we conditionally defining globals, in a method!?

Just ewww
Modified paths:
  • /trunk/extensions/GoogleMaps/GoogleMaps.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GoogleMaps/GoogleMaps.php
@@ -27,10 +27,20 @@
2828 require( "$IP/extensions/GoogleMaps/GoogleMaps.body.php" );
2929
3030 function wfGoogleMaps_CommentJS(&$pParser, &$pText) {
31 - global $wgGoogleMaps;
32 - return $wgGoogleMaps->commentJS($pParser, $pText);
 31+ global $wgGoogleMaps;
 32+ return $wgGoogleMaps->commentJS($pParser, $pText);
3333 }
3434
 35+$wgGoogleMapsKey = null;
 36+$wgGoogleMapsKeys = array( );
 37+$wgGoogleMapsDisableEditorsMap = false;
 38+$wgGoogleMapsEnablePaths = false;
 39+$wgGoogleMapsDefaults = null;
 40+$wgGoogleMapsCustomMessages = null;
 41+$wgGoogleMapsUrlPath = "{$wgScriptPath}/extensions/GoogleMaps";
 42+$wgXhtmlNamespaces = null;
 43+$wgGoogleMapsTemplateVariables = false;
 44+
3545 /**
3646 * This function registers all of the MW hook functions necessary for the
3747 * map extension to function. These hooks are added using the array_unshift
@@ -46,33 +56,6 @@
4757 $wgTitle;
4858 // set up some default values for the various extension configuration parameters
4959 // to keep from getting PHP notices if running in strict mode
50 - if( !isset( $wgGoogleMapsKey ) ) {
51 - $wgGoogleMapsKey = null;
52 - }
53 - if( !isset( $wgGoogleMapsKeys ) ) {
54 - $wgGoogleMapsKeys = array( );
55 - }
56 - if( !isset( $wgGoogleMapsDisableEditorsMap ) ) {
57 - $wgGoogleMapsDisableEditorsMap = false;
58 - }
59 - if( !isset( $wgGoogleMapsEnablePaths ) ) {
60 - $wgGoogleMapsEnablePaths = false;
61 - }
62 - if( !isset( $wgGoogleMapsDefaults ) ) {
63 - $wgGoogleMapsDefaults = null;
64 - }
65 - if( !isset( $wgGoogleMapsCustomMessages ) ) {
66 - $wgGoogleMapsCustomMessages = null;
67 - }
68 - if( !isset( $wgGoogleMapsUrlPath ) ) {
69 - $wgGoogleMapsUrlPath = "{$wgScriptPath}/extensions/GoogleMaps";
70 - }
71 - if( !isset( $wgXhtmlNamespaces ) ) {
72 - $wgXhtmlNamespaces = null;
73 - }
74 - if( !isset( $wgGoogleMapsTemplateVariables ) ) {
75 - $wgGoogleMapsTemplateVariables = false;
76 - }
7760
7861 // make poly-lines work with IE in MW 1.9+. See MW bug #7667
7962 if( is_array( $wgXhtmlNamespaces ) ) {

Comments

#Comment by Jeroen De Dauw (talk | contribs)   22:56, 14 February 2012

But but but... this extension is evil!!!

And I'm not biased! :)

#Comment by Reedy (talk | contribs)   23:21, 14 February 2012

I never said it was good ;)

Status & tagging log