r83890 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83889‎ | r83890 | r83891 >
Date:12:45, 14 March 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
partial revert of r82503 and rem of non-needed if
Modified paths:
  • /trunk/extensions/Maps/Maps.php (modified) (history)
  • /trunk/extensions/Maps/Maps_Settings.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/Maps.php
@@ -35,123 +35,122 @@
3636 if ( ! defined( 'Validator_VERSION' ) ) {
3737 die( '<b>Error:</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>.<br />' );
3838 }
39 -else {
40 - define( 'Maps_VERSION', '0.7.6 alpha' );
4139
42 - // The different coordinate notations.
43 - define( 'Maps_COORDS_FLOAT', 'float' );
44 - define( 'Maps_COORDS_DMS', 'dms' );
45 - define( 'Maps_COORDS_DM', 'dm' );
46 - define( 'Maps_COORDS_DD', 'dd' );
47 -
48 - $useExtensionPath = version_compare( $wgVersion, '1.16', '>=' ) && isset( $wgExtensionAssetsPath ) && $wgExtensionAssetsPath;
49 - $egMapsScriptPath = ( $useExtensionPath ? $wgExtensionAssetsPath : $wgScriptPath . '/extensions' ) . '/Maps';
50 - $egMapsDir = dirname( __FILE__ ) . '/';
51 - unset( $useExtensionPath );
 40+define( 'Maps_VERSION', '0.7.6 alpha' );
5241
53 - $egMapsStyleVersion = $wgStyleVersion . '-' . Maps_VERSION;
 42+// The different coordinate notations.
 43+define( 'Maps_COORDS_FLOAT', 'float' );
 44+define( 'Maps_COORDS_DMS', 'dms' );
 45+define( 'Maps_COORDS_DM', 'dm' );
 46+define( 'Maps_COORDS_DD', 'dd' );
5447
55 - $wgAutoloadClasses['MapsHooks'] = dirname( __FILE__ ) . '/Maps.hooks.php';
56 -
57 - // Autoload the "includes/" classes and interfaces.
58 - $incDir = dirname( __FILE__ ) . '/includes/';
59 - $wgAutoloadClasses['MapsMapper'] = $incDir . 'Maps_Mapper.php';
60 - $wgAutoloadClasses['MapsCoordinateParser'] = $incDir . 'Maps_CoordinateParser.php';
61 - $wgAutoloadClasses['MapsDistanceParser'] = $incDir . 'Maps_DistanceParser.php';
62 - $wgAutoloadClasses['MapsGeoFunctions'] = $incDir . 'Maps_GeoFunctions.php';
63 - $wgAutoloadClasses['MapsGeocoders'] = $incDir . 'Maps_Geocoders.php';
64 - $wgAutoloadClasses['MapsGeocoder'] = $incDir . 'Maps_Geocoder.php';
65 - $wgAutoloadClasses['MapsKMLFormatter'] = $incDir . 'Maps_KMLFormatter.php';
66 - $wgAutoloadClasses['MapsLayer'] = $incDir . 'Maps_Layer.php';
67 - $wgAutoloadClasses['MapsLayerPage'] = $incDir . 'Maps_LayerPage.php';
68 - $wgAutoloadClasses['MapsLayers'] = $incDir . 'Maps_Layers.php';
69 - $wgAutoloadClasses['MapsLocation'] = $incDir . 'Maps_Location.php';
70 - $wgAutoloadClasses['iMappingFeature'] = $incDir . 'iMappingFeature.php';
71 - $wgAutoloadClasses['iMappingService'] = $incDir . 'iMappingService.php';
72 - $wgAutoloadClasses['MapsMappingServices'] = $incDir . 'Maps_MappingServices.php';
73 - $wgAutoloadClasses['MapsMappingService'] = $incDir . 'Maps_MappingService.php';
74 -
75 - // Autoload the "includes/criteria/" classes.
76 - $criDir = $incDir . 'criteria/';
77 - $wgAutoloadClasses['CriterionIsDistance'] = $criDir . 'CriterionIsDistance.php';
78 - $wgAutoloadClasses['CriterionIsImage'] = $criDir . 'CriterionIsImage.php';
79 - $wgAutoloadClasses['CriterionIsLocation'] = $criDir . 'CriterionIsLocation.php';
80 - $wgAutoloadClasses['CriterionMapDimension'] = $criDir . 'CriterionMapDimension.php';
81 - $wgAutoloadClasses['CriterionMapLayer'] = $criDir . 'CriterionMapLayer.php';
82 -
83 - // Autoload the "includes/features/" classes.
84 - $ftDir = $incDir . '/features/';
85 - $wgAutoloadClasses['MapsBaseMap'] = $ftDir . 'Maps_BaseMap.php';
86 - $wgAutoloadClasses['MapsBasePointMap'] = $ftDir . 'Maps_BasePointMap.php';
87 -
88 - // Autoload the "includes/geocoders/" classes.
89 - $geoDir = $incDir . 'geocoders/';
90 - $wgAutoloadClasses['MapsGeonamesGeocoder'] = $geoDir . 'Maps_GeonamesGeocoder.php';
91 - $wgAutoloadClasses['MapsGoogleGeocoder'] = $geoDir . 'Maps_GoogleGeocoder.php';
92 - $wgAutoloadClasses['MapsYahooGeocoder'] = $geoDir . 'Maps_YahooGeocoder.php';
93 -
94 - // Autoload the "includes/layers/" classes.
95 - $lyrDir = $incDir . 'layers/';
96 - $wgAutoloadClasses['MapsImageLayer'] = $lyrDir . 'Maps_ImageLayer.php';
97 - $wgAutoloadClasses['MapsKMLLayer'] = $lyrDir . 'Maps_KMLLayer.php';
98 -
99 - // Autoload the "includes/manipulations/" classes.
100 - $manDir = $incDir . 'manipulations/';
101 - $wgAutoloadClasses['ParamManipulationBoolstr'] = $manDir . 'ParamManipulationBoolstr.php';
102 - $wgAutoloadClasses['MapsParamCoordSet'] = $manDir . 'Maps_ParamCoordSet.php';
103 - $wgAutoloadClasses['MapsParamDimension'] = $manDir . 'Maps_ParamDimension.php';
104 - $wgAutoloadClasses['MapsParamGeoService'] = $manDir . 'Maps_ParamGeoService.php';
105 - $wgAutoloadClasses['MapsParamImage'] = $manDir . 'Maps_ParamImage.php';
106 - $wgAutoloadClasses['MapsParamImageFull'] = $manDir . 'Maps_ParamImageFull.php';
107 - $wgAutoloadClasses['MapsParamLocation'] = $manDir . 'Maps_ParamLocation.php';
108 - $wgAutoloadClasses['MapsParamService'] = $manDir . 'Maps_ParamService.php';
109 - $wgAutoloadClasses['MapsParamZoom'] = $manDir . 'Maps_ParamZoom.php';
110 -
111 - // Autoload the "includes/parserHooks/" classes.
112 - $phDir = $incDir . '/parserHooks/';
113 - $wgAutoloadClasses['MapsCoordinates'] = $phDir . 'Maps_Coordinates.php';
114 - $wgAutoloadClasses['MapsDisplayMap'] = $phDir . 'Maps_DisplayMap.php';
115 - $wgAutoloadClasses['MapsDisplayPoint'] = $phDir . 'Maps_DisplayPoint.php';
116 - $wgAutoloadClasses['MapsDistance'] = $phDir . 'Maps_Distance.php';
117 - $wgAutoloadClasses['MapsFinddestination'] = $phDir . 'Maps_Finddestination.php';
118 - $wgAutoloadClasses['MapsGeocode'] = $phDir . 'Maps_Geocode.php';
119 - $wgAutoloadClasses['MapsGeodistance'] = $phDir . 'Maps_Geodistance.php';
120 -
121 - // To ensure Maps remains compatible with pre 1.16.
122 - if ( !class_exists( 'Html' ) ) {
123 - $wgAutoloadClasses['Html'] = $egMapsDir . 'compat/Html.php';
124 - }
125 -
126 - if ( version_compare( $wgVersion, '1.16alpha', '>=' ) ) {
127 - $wgExtensionMessagesFiles['MapsMagic'] = $egMapsDir . 'Maps.i18n.magic.php';
128 - }
129 -
130 - $wgExtensionMessagesFiles['Maps'] = $egMapsDir . 'Maps.i18n.php';
 48+$useExtensionPath = version_compare( $wgVersion, '1.16', '>=' ) && isset( $wgExtensionAssetsPath ) && $wgExtensionAssetsPath;
 49+$egMapsScriptPath = ( $useExtensionPath ? $wgExtensionAssetsPath : $wgScriptPath . '/extensions' ) . '/Maps';
 50+$egMapsDir = dirname( __FILE__ ) . '/';
 51+unset( $useExtensionPath );
13152
132 - // Register the initialization function of Maps.
133 - $wgExtensionFunctions[] = 'efMapsSetup';
 53+$egMapsStyleVersion = $wgStyleVersion . '-' . Maps_VERSION;
13454
135 - // Since 0.2
136 - $wgHooks['AdminLinks'][] = 'MapsHooks::addToAdminLinks';
137 -
138 - // Since 0.6.5
139 - $wgHooks['UnitTestsList'][] = 'MapsHooks::registerUnitTests';
140 -
141 - // Since 0.7
142 - $wgHooks['SkinAfterBottomScripts'][] = 'MapsHooks::addOnloadFunction';
143 -
144 - // Since 0.7.1
145 - $wgHooks['ArticleFromTitle'][] = 'MapsHooks::onArticleFromTitle';
146 -
147 - $egMapsFeatures = array();
148 -
149 - // Include the settings file.
150 - require_once $egMapsDir . 'Maps_Settings.php';
151 -
152 - define( 'Maps_NS_LAYER', $egMapsNamespaceIndex + 0 );
153 - define( 'Maps_NS_LAYER_TALK', $egMapsNamespaceIndex + 1 );
154 -}
 55+$wgAutoloadClasses['MapsHooks'] = dirname( __FILE__ ) . '/Maps.hooks.php';
15556
 57+// Autoload the "includes/" classes and interfaces.
 58+$incDir = dirname( __FILE__ ) . '/includes/';
 59+$wgAutoloadClasses['MapsMapper'] = $incDir . 'Maps_Mapper.php';
 60+$wgAutoloadClasses['MapsCoordinateParser'] = $incDir . 'Maps_CoordinateParser.php';
 61+$wgAutoloadClasses['MapsDistanceParser'] = $incDir . 'Maps_DistanceParser.php';
 62+$wgAutoloadClasses['MapsGeoFunctions'] = $incDir . 'Maps_GeoFunctions.php';
 63+$wgAutoloadClasses['MapsGeocoders'] = $incDir . 'Maps_Geocoders.php';
 64+$wgAutoloadClasses['MapsGeocoder'] = $incDir . 'Maps_Geocoder.php';
 65+$wgAutoloadClasses['MapsKMLFormatter'] = $incDir . 'Maps_KMLFormatter.php';
 66+$wgAutoloadClasses['MapsLayer'] = $incDir . 'Maps_Layer.php';
 67+$wgAutoloadClasses['MapsLayerPage'] = $incDir . 'Maps_LayerPage.php';
 68+$wgAutoloadClasses['MapsLayers'] = $incDir . 'Maps_Layers.php';
 69+$wgAutoloadClasses['MapsLocation'] = $incDir . 'Maps_Location.php';
 70+$wgAutoloadClasses['iMappingFeature'] = $incDir . 'iMappingFeature.php';
 71+$wgAutoloadClasses['iMappingService'] = $incDir . 'iMappingService.php';
 72+$wgAutoloadClasses['MapsMappingServices'] = $incDir . 'Maps_MappingServices.php';
 73+$wgAutoloadClasses['MapsMappingService'] = $incDir . 'Maps_MappingService.php';
 74+
 75+// Autoload the "includes/criteria/" classes.
 76+$criDir = $incDir . 'criteria/';
 77+$wgAutoloadClasses['CriterionIsDistance'] = $criDir . 'CriterionIsDistance.php';
 78+$wgAutoloadClasses['CriterionIsImage'] = $criDir . 'CriterionIsImage.php';
 79+$wgAutoloadClasses['CriterionIsLocation'] = $criDir . 'CriterionIsLocation.php';
 80+$wgAutoloadClasses['CriterionMapDimension'] = $criDir . 'CriterionMapDimension.php';
 81+$wgAutoloadClasses['CriterionMapLayer'] = $criDir . 'CriterionMapLayer.php';
 82+
 83+// Autoload the "includes/features/" classes.
 84+$ftDir = $incDir . '/features/';
 85+$wgAutoloadClasses['MapsBaseMap'] = $ftDir . 'Maps_BaseMap.php';
 86+$wgAutoloadClasses['MapsBasePointMap'] = $ftDir . 'Maps_BasePointMap.php';
 87+
 88+// Autoload the "includes/geocoders/" classes.
 89+$geoDir = $incDir . 'geocoders/';
 90+$wgAutoloadClasses['MapsGeonamesGeocoder'] = $geoDir . 'Maps_GeonamesGeocoder.php';
 91+$wgAutoloadClasses['MapsGoogleGeocoder'] = $geoDir . 'Maps_GoogleGeocoder.php';
 92+$wgAutoloadClasses['MapsYahooGeocoder'] = $geoDir . 'Maps_YahooGeocoder.php';
 93+
 94+// Autoload the "includes/layers/" classes.
 95+$lyrDir = $incDir . 'layers/';
 96+$wgAutoloadClasses['MapsImageLayer'] = $lyrDir . 'Maps_ImageLayer.php';
 97+$wgAutoloadClasses['MapsKMLLayer'] = $lyrDir . 'Maps_KMLLayer.php';
 98+
 99+// Autoload the "includes/manipulations/" classes.
 100+$manDir = $incDir . 'manipulations/';
 101+$wgAutoloadClasses['ParamManipulationBoolstr'] = $manDir . 'ParamManipulationBoolstr.php';
 102+$wgAutoloadClasses['MapsParamCoordSet'] = $manDir . 'Maps_ParamCoordSet.php';
 103+$wgAutoloadClasses['MapsParamDimension'] = $manDir . 'Maps_ParamDimension.php';
 104+$wgAutoloadClasses['MapsParamGeoService'] = $manDir . 'Maps_ParamGeoService.php';
 105+$wgAutoloadClasses['MapsParamImage'] = $manDir . 'Maps_ParamImage.php';
 106+$wgAutoloadClasses['MapsParamImageFull'] = $manDir . 'Maps_ParamImageFull.php';
 107+$wgAutoloadClasses['MapsParamLocation'] = $manDir . 'Maps_ParamLocation.php';
 108+$wgAutoloadClasses['MapsParamService'] = $manDir . 'Maps_ParamService.php';
 109+$wgAutoloadClasses['MapsParamZoom'] = $manDir . 'Maps_ParamZoom.php';
 110+
 111+// Autoload the "includes/parserHooks/" classes.
 112+$phDir = $incDir . '/parserHooks/';
 113+$wgAutoloadClasses['MapsCoordinates'] = $phDir . 'Maps_Coordinates.php';
 114+$wgAutoloadClasses['MapsDisplayMap'] = $phDir . 'Maps_DisplayMap.php';
 115+$wgAutoloadClasses['MapsDisplayPoint'] = $phDir . 'Maps_DisplayPoint.php';
 116+$wgAutoloadClasses['MapsDistance'] = $phDir . 'Maps_Distance.php';
 117+$wgAutoloadClasses['MapsFinddestination'] = $phDir . 'Maps_Finddestination.php';
 118+$wgAutoloadClasses['MapsGeocode'] = $phDir . 'Maps_Geocode.php';
 119+$wgAutoloadClasses['MapsGeodistance'] = $phDir . 'Maps_Geodistance.php';
 120+
 121+// To ensure Maps remains compatible with pre 1.16.
 122+if ( !class_exists( 'Html' ) ) {
 123+ $wgAutoloadClasses['Html'] = $egMapsDir . 'compat/Html.php';
 124+}
 125+
 126+if ( version_compare( $wgVersion, '1.16alpha', '>=' ) ) {
 127+ $wgExtensionMessagesFiles['MapsMagic'] = $egMapsDir . 'Maps.i18n.magic.php';
 128+}
 129+
 130+$wgExtensionMessagesFiles['Maps'] = $egMapsDir . 'Maps.i18n.php';
 131+
 132+// Register the initialization function of Maps.
 133+$wgExtensionFunctions[] = 'efMapsSetup';
 134+
 135+// Since 0.2
 136+$wgHooks['AdminLinks'][] = 'MapsHooks::addToAdminLinks';
 137+
 138+// Since 0.6.5
 139+$wgHooks['UnitTestsList'][] = 'MapsHooks::registerUnitTests';
 140+
 141+// Since 0.7
 142+$wgHooks['SkinAfterBottomScripts'][] = 'MapsHooks::addOnloadFunction';
 143+
 144+// Since 0.7.1
 145+$wgHooks['ArticleFromTitle'][] = 'MapsHooks::onArticleFromTitle';
 146+
 147+$egMapsFeatures = array();
 148+
 149+// Include the settings file.
 150+require_once $egMapsDir . 'Maps_Settings.php';
 151+
 152+define( 'Maps_NS_LAYER', $egMapsNamespaceIndex + 0 );
 153+define( 'Maps_NS_LAYER_TALK', $egMapsNamespaceIndex + 1 );
 154+
156155 /**
157156 * Initialization function for the Maps extension.
158157 *
@@ -180,7 +179,7 @@
181180 wfMsg( 'maps-ns-layer' ) => Maps_NS_LAYER,
182181 wfMsg( 'maps-ns-layer-talk' ) => Maps_NS_LAYER_TALK
183182 );
184 -
 183+
185184 wfRunHooks( 'MappingServiceLoad' );
186185 wfRunHooks( 'MappingFeatureLoad' );
187186
@@ -198,7 +197,9 @@
199198 '[http://www.mediawiki.org/wiki/Extension:Maps/Credits ' . wfMsg( 'maps-others' ) . ']'
200199 ),
201200 'url' => 'http://www.mediawiki.org/wiki/Extension:Maps',
202 - 'description' => wfMsgExt( 'maps_desc', 'parsemag', $servicesList, count($servicesList) ),
 201+ // Want to "fix" this? Sure, but test your code!
 202+ // This breaks stuff: http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/Maps/Maps.php?r1=82288&r2=82503
 203+ 'description' => wfMsgExt( 'maps_desc', 'parsemag', $servicesList ),
203204 );
204205
205206 return true;
Index: trunk/extensions/Maps/Maps_Settings.php
@@ -21,8 +21,6 @@
2222
2323
2424
25 -$egMapsUseRL = false; //method_exists( 'OutputPage', 'addModules' );
26 -
2725 # Features configuration
2826 # Commenting out the inclusion of any feature will make Maps completely ignore it, and so improve performance.
2927

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r82503I18n: PLURAL support added to message 'maps_desc'...purodha07:23, 20 February 2011

Status & tagging log