r68214 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68213‎ | r68214 | r68215 >
Date:11:01, 18 June 2010
Author:reedy
Status:ok
Tags:
Comment:
Revert r62840
Modified paths:
  • /trunk/extensions/AssertEdit/ApiAssertEdit.php (deleted) (history)
  • /trunk/extensions/AssertEdit/AssertEdit.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AssertEdit/ApiAssertEdit.php
@@ -1,58 +0,0 @@
2 -<?php
3 -if ( !defined( 'MEDIAWIKI' ) ) {
4 - // Eclipse helper - will be ignored in production
5 - require_once( 'ApiBase.php' );
6 -}
7 -
8 -class ApiAssertEdit extends ApiBase {
9 -
10 - public function __construct( $main, $action ) {
11 - parent::__construct( $main, $action );
12 - }
13 -
14 - public function execute() {
15 - $this->dieUsage( '', 'assertedit' );
16 - }
17 -
18 - public function getDescription() {
19 - return 'Allows bots to make assertions. Can only be used during of editing';
20 - }
21 -
22 - public function isReadMode() {
23 - return false;
24 - }
25 -
26 - public function shouldCheckMaxlag() {
27 - return false;
28 - }
29 -
30 - public function getParamDescription() {
31 - return array(
32 - 'user' => 'Verify that bot is logged in, to prevent anonymous edits.',
33 - 'bot' => 'Verify that bot is logged in and has a bot flag.',
34 - 'true' => 'Always true; nassert=true will fail if the extension is installed.',
35 - 'false' => 'Always false; assert=false will fail if the extension is installed.',
36 - 'exists' => 'Verify that page exists. Could be useful from other extensions, i.e. adding nassert=exists to the inputbox extension.',
37 - 'test' => 'Verify that this wiki allows random testing. Defaults to false, but can be overridden in LocalSettings.php.'
38 - );
39 - }
40 -
41 - public function getPossibleErrors() {
42 - return array();
43 - }
44 -
45 - public function getAllowedParams() {
46 - return array(
47 - 'user' => null,
48 - 'bot' => null,
49 - 'true' => null,
50 - 'false' => null,
51 - 'exists' => null,
52 - 'test' => null
53 - );
54 - }
55 -
56 - public function getVersion() {
57 - return __CLASS__ . ': $Id$';
58 - }
59 -}
Index: trunk/extensions/AssertEdit/AssertEdit.php
@@ -30,9 +30,6 @@
3131 $wgHooks['AlternateEdit'][] = 'efAssertEditHook';
3232 $wgHooks['APIEditBeforeSave'][] = 'efAssertApiEditHook';
3333
34 -$wgAutoloadClasses['ApiAssertEdit'] = $dir . "ApiAssertEdit.php";
35 -$wgAPIModules['assertedit'] = 'ApiAssertEdit';
36 -
3734 function efAssertEditHook( $editpage ) {
3835 global $wgOut, $wgRequest;
3936

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r62840Add a simple Api Module to display the possible parameters (ie an API help) f...reedy20:54, 22 February 2010

Status & tagging log