r83889 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83888‎ | r83889 | r83890 >
Date:12:28, 14 March 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
rem dead code
Modified paths:
  • /trunk/extensions/Maps/Maps.hooks.php (modified) (history)
  • /trunk/extensions/Maps/Maps.php (modified) (history)
  • /trunk/extensions/Maps/includes/Maps_MappingService.php (modified) (history)
  • /trunk/extensions/Maps/includes/services/OpenLayers/Maps_OpenLayers.php (modified) (history)
  • /trunk/extensions/Maps/includes/services/OpenLayers/OpenLayers.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/Maps.php
@@ -140,9 +140,6 @@
141141 // Since 0.7
142142 $wgHooks['SkinAfterBottomScripts'][] = 'MapsHooks::addOnloadFunction';
143143
144 - // Since 0.7
145 - $wgHooks['ResourceLoaderRegisterModules'][] = 'MapsHooks::registerResourceLoaderModules';
146 -
147144 // Since 0.7.1
148145 $wgHooks['ArticleFromTitle'][] = 'MapsHooks::onArticleFromTitle';
149146
Index: trunk/extensions/Maps/includes/Maps_MappingService.php
@@ -41,15 +41,6 @@
4242 protected $features;
4343
4444 /**
45 - * A list of names of resource modules to add.
46 - *
47 - * @since 0.7.3
48 - *
49 - * @var array
50 - */
51 - protected $resourceModules = array();
52 -
53 - /**
5445 * A list of dependencies (header items) that have been added.
5546 *
5647 * @since 0.6.3
@@ -123,19 +114,11 @@
124115 if ( $dependencies ) {
125116 $parserOrOut->getOutput()->addHeadItem( $dependencies );
126117 }
127 -
128 - if ( $egMapsUseRL /* method_exists( $parserOrOut->getOutput(), 'addModules' ) */ ) {
129 - $parserOrOut->getOutput()->addModules( $this->getResourceModules() );
130 - }
131118 }
132119 else if ( $parserOrOut instanceof OutputPage ) {
133120 if ( $dependencies ) {
134121 $parserOrOut->addHeadItem( md5( $dependencies ), $dependencies );
135122 }
136 -
137 - if ( $egMapsUseRL /* method_exists( $parserOrOut, 'addModules' ) */ ) {
138 - $parserOrOut->addModules( $this->getResourceModules() );
139 - }
140123 }
141124 }
142125
@@ -231,26 +214,4 @@
232215 return array();
233216 }
234217
235 - /**
236 - * Returns the resource modules that need to be loaded to use this mapping service.
237 - *
238 - * @since 0.7.3
239 - *
240 - * @return array of string
241 - */
242 - protected function getResourceModules() {
243 - return $this->resourceModules;
244 - }
245 -
246 - /**
247 - * Add one or more names of resource modules that should be loaded.
248 - *
249 - * @since 0.7.3
250 - *
251 - * @param mixed $modules Array of string or string
252 - */
253 - public function addResourceModules( $modules ) {
254 - $this->resourceModules = array_merge( $this->resourceModules, (array)$modules );
255 - }
256 -
257218 }
\ No newline at end of file
Index: trunk/extensions/Maps/includes/services/OpenLayers/Maps_OpenLayers.php
@@ -177,64 +177,4 @@
178178 }
179179 }
180180
181 - /**
182 - * @see MapsMappingService::getResourceModules
183 - *
184 - * @since 0.7.3
185 - *
186 - * @return array of string
187 - */
188 - protected function getResourceModules() {
189 - return array_merge(
190 - parent::getResourceModules(),
191 - array( 'ext.maps.openlayers' )
192 - );
193 - }
194 -
195 - /**
196 - * Register the resource modules for the resource loader.
197 - *
198 - * @since 0.7.3
199 - *
200 - * @param ResourceLoader $resourceLoader
201 - *
202 - * @return true
203 - */
204 - public static function registerResourceLoaderModules( ResourceLoader &$resourceLoader ) {
205 - global $egMapsScriptPath, $egMapsOLLayerModules;
206 -
207 - $modules = array(
208 - 'ext.maps.openlayers' => array(
209 - 'scripts' => array(
210 - 'OpenLayers/OpenLayers.js',
211 - 'ext.maps.openlayers.js'
212 - ),
213 - 'styles' => array(
214 - 'OpenLayers/theme/default/style.css'
215 - ),
216 - 'messages' => array(
217 - 'maps-markers'
218 - )
219 - ),
220 - );
221 -
222 - foreach ( $egMapsOLLayerModules as $name => &$data ) {
223 - $data['dependencies'] = array_key_exists( 'dependencies', $data ) ?
224 - array_merge( (array)$data['dependencies'], array( 'ext.maps.openlayers' ) ) :
225 - array( 'ext.maps.openlayers' );
226 - }
227 -
228 - $modules = array_merge( $modules, $egMapsOLLayerModules );
229 -
230 - foreach ( $modules as $name => $resources ) {
231 - $resourceLoader->register( $name, new ResourceLoaderFileModule(
232 - array_merge_recursive( $resources, array( 'group' => 'ext.maps' ) ),
233 - dirname( __FILE__ ),
234 - $egMapsScriptPath . '/includes/services/OpenLayers'
235 - ) );
236 - }
237 -
238 - return true;
239 - }
240 -
241181 }
\ No newline at end of file
Index: trunk/extensions/Maps/includes/services/OpenLayers/OpenLayers.php
@@ -26,9 +26,6 @@
2727 $wgAutoloadClasses['MapsOpenLayersDispPoint'] = dirname( __FILE__ ) . '/Maps_OpenLayersDispPoint.php';
2828 $wgAutoloadClasses['MapsParamOLLayers'] = dirname( __FILE__ ) . '/Maps_ParamOLLayers.php';
2929
30 -// Since 0.7.3
31 -$wgHooks['ResourceLoaderRegisterModules'][] = 'MapsOpenLayers::registerResourceLoaderModules';
32 -
3330 MapsMappingServices::registerService(
3431 'openlayers',
3532 'MapsOpenLayers',
Index: trunk/extensions/Maps/Maps.hooks.php
@@ -60,35 +60,6 @@
6161 }
6262
6363 /**
64 - * Register the resource modules for the resource loader.
65 - *
66 - * @since 0.7
67 - *
68 - * @param ResourceLoader $resourceLoader
69 - *
70 - * @return true
71 - */
72 - public static function registerResourceLoaderModules( ResourceLoader &$resourceLoader ) {
73 - global $egMapsScriptPath;
74 - /*
75 - $modules = array(
76 - 'ext.maps.common' => array(
77 -
78 - ),
79 - );
80 -
81 - foreach ( $modules as $name => $resources ) {
82 - $resourceLoader->register( $name, new ResourceLoaderFileModule(
83 - $resources,
84 - dirname( __FILE__ ),
85 - $egMapsScriptPath'
86 - ) );
87 - }
88 - */
89 - return true;
90 - }
91 -
92 - /**
9364 * Intercept pages in the Layer namespace to handle them correctly.
9465 *
9566 * @param $title: Title

Status & tagging log