r69202 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69201‎ | r69202 | r69203 >
Date:09:46, 9 July 2010
Author:btongminh
Status:ok
Tags:
Comment:
Revert r64436, r64437, r64508 per CR r64436
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/AutoLoader.php (modified) (history)
  • /trunk/phase3/includes/api/ApiGo.php (deleted) (history)
  • /trunk/phase3/includes/api/ApiMain.php (modified) (history)

Diff [purge]

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 @@
6464 'parse' => 'ApiParse',
6565 'opensearch' => 'ApiOpenSearch',
6666 'feedwatchlist' => 'ApiFeedWatchlist',
67 - 'go' => 'ApiGo',
6867 'help' => 'ApiHelp',
6968 'paraminfo' => 'ApiParamInfo',
7069
Index: trunk/phase3/includes/AutoLoader.php
@@ -262,7 +262,6 @@
263263 'ApiFormatWddx' => 'includes/api/ApiFormatWddx.php',
264264 'ApiFormatXml' => 'includes/api/ApiFormatXml.php',
265265 'ApiFormatYaml' => 'includes/api/ApiFormatYaml.php',
266 - 'ApiGo' => 'includes/api/ApiGo.php',
267266 'ApiHelp' => 'includes/api/ApiHelp.php',
268267 'ApiImport' => 'includes/api/ApiImport.php',
269268 'ApiImportReporter' => 'includes/api/ApiImport.php',
Index: trunk/phase3/RELEASE-NOTES
@@ -238,7 +238,6 @@
239239 * (bug 22738) Allow filtering by action type on query=logevent.
240240 * (bug 22764) uselang parameter for action=parse.
241241 * (bug 22944) API: watchlist options are inconsistent.
242 -* (bug 22339) "Go" result should be available through the API.
243242 * (bug 22868) don't list infinite block expiry date as "now" in API logevents.
244243 * (bug 22290) prop=revisions now outputs "comment" field even when comment.
245244 is empty, for consistency with list=recentchanges.

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r64436(bug 22339) "Go" result should be available through the APIgurch14:08, 31 March 2010
r64437release notes for r64436gurch14:39, 31 March 2010
r64508svn:keywords Id for r64436reedy22:38, 1 April 2010

Status & tagging log