r60391 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60390‎ | r60391 | r60392 >
Date:16:29, 25 December 2009
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Maps 0.5.1 rc2.
Modified paths:
  • /trunk/extensions/Maps/Maps.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/Maps.php
@@ -33,7 +33,7 @@
3434 echo '<b>Warning:</b> You need to have <a href="http://www.mediawiki.org/wiki/Extension:Validator">Validator</a> installed in order to use <a href="http://www.mediawiki.org/wiki/Extension:Maps">Maps</a>.';
3535 }
3636 else {
37 - define('Maps_VERSION', '0.5.1 rc1');
 37+ define('Maps_VERSION', '0.5.1 rc2');
3838
3939 $egMapsScriptPath = $wgScriptPath . '/extensions/Maps';
4040 $egMapsIP = $IP . '/extensions/Maps';
@@ -44,7 +44,7 @@
4545 require_once($egMapsIP . '/Maps_Settings.php');
4646
4747 // Register the initialization function of Maps.
48 - $wgExtensionFunctions[] = 'efMapsSetup';
 48+ $wgExtensionFunctions[] = 'efMapsSetup';
4949
5050 $wgExtensionMessagesFiles['Maps'] = $egMapsIP . '/Maps.i18n.php';
5151
@@ -93,28 +93,28 @@
9494 'description' => wfMsgExt( 'maps_desc', 'parsemag', $services_list ),
9595 'descriptionmsg' => wfMsgExt( 'maps_desc', 'parsemag', $services_list ),
9696 );
97 -
 97+
9898 MapsMapper::initializeMainParams();
99 -
100 - // These loops take care of everything hooked into Maps.
 99+
 100+ // Loop through the available mapping features, load and initialize them.
101101 foreach($egMapsAvailableFeatures as $key => $values) {
102102 // Load and optionally initizlize feature.
103103 if (array_key_exists('class', $values) && array_key_exists('file', $values) && array_key_exists('local', $values)) {
104 - $wgAutoloadClasses[$values['class']] = $values['local'] ? $egMapsIP . '/' . $values['file'] : $IP . '/extensions/' . $values['file'];
 104+ $wgAutoloadClasses[$values['class']] = array_key_exists('local', $values) && $values['local'] ? $egMapsIP . '/' . $values['file'] : $IP . '/extensions/' . $values['file'];
105105 if (method_exists($values['class'], 'initialize')) call_user_func(array($values['class'], 'initialize'));
106106 }
107107 }
108 -
109 - // Check for wich services there are handlers for the current fature, and load them
 108+
 109+ // Loop through the available mapping services to load and initialize their general classes.
110110 foreach ($egMapsServices as $serviceData) {
111111 if (array_key_exists('classes', $serviceData)) {
112112 foreach($serviceData['classes'] as $class) {
113 - $file = $class['local'] ? $egMapsIP . '/' . $class['file'] : $IP . '/extensions/' . $class['file'];
 113+ $file = array_key_exists('local', $class) && $class['local'] ? $egMapsIP . '/' . $class['file'] : $IP . '/extensions/' . $class['file'];
114114 $wgAutoloadClasses[$class['class']] = $file;
115115 if (method_exists($class['class'], 'initialize')) call_user_func(array($class['class'], 'initialize'));
116116 }
117 - }
118 - }
 117+ }
 118+ }
119119
120120 return true;
121121 }

Status & tagging log