r108285 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108284‎ | r108285 | r108286 >
Date:22:02, 6 January 2012
Author:maxsem
Status:ok
Tags:
Comment:
* Error codes
* 1.19 is soon enough, whee
Modified paths:
  • /trunk/extensions/GeoData/ApiQueryGeoSearch.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GeoData/ApiQueryGeoSearch.php
@@ -194,22 +194,17 @@
195195
196196 public function getPossibleErrors() {
197197 return array_merge( parent::getPossibleErrors(), array(
 198+ array( 'code' => '_invalid-page', 'info' => "Invalid page title provided" ),
 199+ array( 'code' => '_nonexistent-page', 'info' => "Page does not exist" ),
 200+ array( 'code' => '_no-coordinates', 'info' => 'Page coordinates unknown' ),
198201 ) );//@todo:
199202 }
200203
201204 public function getExamples() {
202 - global $wgVersion;
203 - if ( version_compare( $wgVersion, '1.19alpha', '>=' ) ) {
204 - return array(
205 - "api.php?action=query&list=geosearch&gsccord=37.786971|-122.399677" =>
206 - "Search around the point with coordinates 37° 47′ 13.1″ N, 122° 23′ 58.84″ W",
207 - );
208 - } else {
209 - return array(
 205+ return array(
 206+ "api.php?action=query&list=geosearch&gsccord=37.786971|-122.399677" =>
210207 "Search around the point with coordinates 37° 47′ 13.1″ N, 122° 23′ 58.84″ W",
211 - " api.php?action=query&list=geosearch&gsccord=37.786971|-122.399677"
212 - );
213 - }
 208+ );
214209 }
215210
216211 public function getVersion() {

Status & tagging log