Index: trunk/phase3/includes/api/ApiGo.php |
— | — | @@ -1,95 +0,0 @@ |
2 | | -<?php |
3 | | - |
4 | | -/** |
5 | | - * Created on Mar 30, 2010 |
6 | | - * API for MediaWiki 1.8+ |
7 | | - * |
8 | | - * Copyright © 2010 Matthew Britton <Firstname>.<Lastname>@btinternet.com |
9 | | - * |
10 | | - * This program is free software; you can redistribute it and/or modify |
11 | | - * it under the terms of the GNU General Public License as published by |
12 | | - * the Free Software Foundation; either version 2 of the License, or |
13 | | - * (at your option) any later version. |
14 | | - * |
15 | | - * This program is distributed in the hope that it will be useful, |
16 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18 | | - * GNU General Public License for more details. |
19 | | - * |
20 | | - * You should have received a copy of the GNU General Public License along |
21 | | - * with this program; if not, write to the Free Software Foundation, Inc., |
22 | | - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
23 | | - * http://www.gnu.org/copyleft/gpl.html |
24 | | - */ |
25 | | - |
26 | | -if ( !defined( 'MEDIAWIKI' ) ) { |
27 | | - // Eclipse helper - will be ignored in production |
28 | | - require_once( "ApiBase.php" ); |
29 | | -} |
30 | | - |
31 | | -/** |
32 | | -* API module to determine the result of a "Go" search |
33 | | -* |
34 | | - * @ingroup API |
35 | | - */ |
36 | | -class ApiGo extends ApiBase { |
37 | | - public function __construct( $main, $action ) { |
38 | | - parent::__construct( $main, $action ); |
39 | | - } |
40 | | - |
41 | | - public function execute() { |
42 | | - $params = $this->extractRequestParams(); |
43 | | - $text = $params['text']; |
44 | | - |
45 | | - if ( is_null( $text ) ) { |
46 | | - $this->dieUsageMsg( array( 'missingparam', 'text' ) ); |
47 | | - } |
48 | | - |
49 | | - // Strip underscores |
50 | | - $text = str_replace( '_', ' ', $text ); |
51 | | - |
52 | | - $nearMatch = SearchEngine::getNearMatch( $text ); |
53 | | - |
54 | | - $this->getResult()->addValue( null, $this->getModuleName(), array( 'text' => $text, 'result' => $nearMatch ) ); |
55 | | - } |
56 | | - |
57 | | - public function mustBePosted() { |
58 | | - return false; |
59 | | - } |
60 | | - |
61 | | - public function isWriteMode() { |
62 | | - return false; |
63 | | - } |
64 | | - |
65 | | - public function getAllowedParams() { |
66 | | - return array( |
67 | | - 'text' => null, |
68 | | - ); |
69 | | - } |
70 | | - |
71 | | - public function getParamDescription() { |
72 | | - return array( |
73 | | - 'text' => 'Text to try a "Go" match for' |
74 | | - ); |
75 | | - } |
76 | | - |
77 | | - public function getDescription() { |
78 | | - return 'Determine the title one will be taken to by a "Go" search, if any'; |
79 | | - } |
80 | | - |
81 | | - public function getPossibleErrors() { |
82 | | - return array_merge( parent::getPossibleErrors(), array( |
83 | | - array( 'missingparam', 'text' ) |
84 | | - ) ); |
85 | | - } |
86 | | - |
87 | | - protected function getExamples() { |
88 | | - return array( |
89 | | - 'api.php?action=go&text=Foo' |
90 | | - ); |
91 | | - } |
92 | | - |
93 | | - public function getVersion() { |
94 | | - return __CLASS__ . ': $Id$'; |
95 | | - } |
96 | | -} |
Index: trunk/phase3/includes/api/ApiMain.php |
— | — | @@ -63,7 +63,6 @@ |
64 | 64 | 'parse' => 'ApiParse', |
65 | 65 | 'opensearch' => 'ApiOpenSearch', |
66 | 66 | 'feedwatchlist' => 'ApiFeedWatchlist', |
67 | | - 'go' => 'ApiGo', |
68 | 67 | 'help' => 'ApiHelp', |
69 | 68 | 'paraminfo' => 'ApiParamInfo', |
70 | 69 | |
Index: trunk/phase3/includes/AutoLoader.php |
— | — | @@ -262,7 +262,6 @@ |
263 | 263 | 'ApiFormatWddx' => 'includes/api/ApiFormatWddx.php', |
264 | 264 | 'ApiFormatXml' => 'includes/api/ApiFormatXml.php', |
265 | 265 | 'ApiFormatYaml' => 'includes/api/ApiFormatYaml.php', |
266 | | - 'ApiGo' => 'includes/api/ApiGo.php', |
267 | 266 | 'ApiHelp' => 'includes/api/ApiHelp.php', |
268 | 267 | 'ApiImport' => 'includes/api/ApiImport.php', |
269 | 268 | 'ApiImportReporter' => 'includes/api/ApiImport.php', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -238,7 +238,6 @@ |
239 | 239 | * (bug 22738) Allow filtering by action type on query=logevent. |
240 | 240 | * (bug 22764) uselang parameter for action=parse. |
241 | 241 | * (bug 22944) API: watchlist options are inconsistent. |
242 | | -* (bug 22339) "Go" result should be available through the API. |
243 | 242 | * (bug 22868) don't list infinite block expiry date as "now" in API logevents. |
244 | 243 | * (bug 22290) prop=revisions now outputs "comment" field even when comment. |
245 | 244 | is empty, for consistency with list=recentchanges. |