r109947 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109946‎ | r109947 | r109948 >
Date:20:24, 24 January 2012
Author:maxsem
Status:ok (Comments)
Tags:
Comment:
Follow-up r109940: instead of overriding core modules, add the extended modules under different names
Modified paths:
  • /trunk/extensions/GeoData/GeoData.php (modified) (history)
  • /trunk/extensions/GeoData/api/ApiQueryAllPages_GeoData.php (modified) (history)
  • /trunk/extensions/GeoData/api/ApiQueryCategoryMembers_GeoData.php (modified) (history)
  • /trunk/extensions/GeoData/api/GeoDataQueryExtender.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GeoData/api/GeoDataQueryExtender.php
@@ -60,8 +60,4 @@
6161 'withoutcoordinates' => 'Return only pages without coordinates',
6262 );
6363 }
64 -
65 - public static function getDescription() {
66 - return ' (extended by the GeoData extension)';
67 - }
6864 }
Index: trunk/extensions/GeoData/api/ApiQueryAllPages_GeoData.php
@@ -14,7 +14,7 @@
1515 if ( !$this->alreadyAltered ) {
1616 $params = $this->extractRequestParams();
1717
18 - $this->requireMaxOneParameter( $params, 'withcoordinates', 'withoutcoordinates' );
 18+ $this->requireOnlyOneParameter( $params, 'withcoordinates', 'withoutcoordinates' );
1919
2020 list( $tables, $fields, $joins, $options, $where ) =
2121 GeoDataQueryExtender::alterQuery( $params, 'page_id', $this->useIndex );
@@ -43,7 +43,7 @@
4444 }
4545
4646 public function getDescription() {
47 - return parent::getDescription() . GeoDataQueryExtender::getDescription();
 47+ return 'Lists pages with or without coordinates';
4848 }
4949
5050 public function getAllowedParams() {
Index: trunk/extensions/GeoData/api/ApiQueryCategoryMembers_GeoData.php
@@ -14,7 +14,7 @@
1515 if ( !$this->alreadyAltered ) {
1616 $params = $this->extractRequestParams();
1717
18 - $this->requireMaxOneParameter( $params, 'withcoordinates', 'withoutcoordinates' );
 18+ $this->requireOnlyOneParameter( $params, 'withcoordinates', 'withoutcoordinates' );
1919
2020 list( $tables, $fields, $joins, $options, $where ) =
2121 GeoDataQueryExtender::alterQuery( $params, 'cl_from', $this->useIndex );
@@ -43,7 +43,7 @@
4444 }
4545
4646 public function getDescription() {
47 - return parent::getDescription() . GeoDataQueryExtender::getDescription();
 47+ return 'Lists pages with or without coordinates in a given category';
4848 }
4949
5050 public function getAllowedParams() {
Index: trunk/extensions/GeoData/GeoData.php
@@ -30,11 +30,9 @@
3131
3232 $wgAPIListModules['geosearch'] = 'ApiQueryGeoSearch';
3333 $wgAPIPropModules['coordinates'] = 'ApiQueryCoordinates';
 34+$wgAPIListModules['geopages'] = 'ApiQueryAllPages_GeoData';
 35+$wgAPIListModules['geopagesincategory'] = 'ApiQueryCategoryMembers_GeoData';
3436
35 -// overriding core
36 -$wgAPIListModules['allpages'] = 'ApiQueryAllPages_GeoData';
37 -$wgAPIListModules['categorymembers'] = 'ApiQueryCategoryMembers_GeoData';
38 -
3937 $wgHooks['LoadExtensionSchemaUpdates'][] = 'GeoDataHooks::onLoadExtensionSchemaUpdates';
4038 $wgHooks['ParserFirstCallInit'][] = 'GeoDataHooks::onParserFirstCallInit';
4139 $wgHooks['UnitTestsList'][] = 'GeoDataHooks::onUnitTestsList';

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r109940Support for enumerating pages with or without coordinates, in specific catego...maxsem19:16, 24 January 2012

Comments

#Comment by Johnduhart (talk | contribs)   20:43, 24 January 2012

Thanks you, this is much better.

Status & tagging log