r62874 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62873‎ | r62874 | r62875 >
Date:12:31, 23 February 2010
Author:reedy
Status:reverted
Tags:
Comment:
Followup r62840, rename file as per Gurchs comment
Modified paths:
  • /trunk/extensions/AssertEdit/ApiAssertEdit.php (added) (history)
  • /trunk/extensions/AssertEdit/AssertEdit.php (modified) (history)
  • /trunk/extensions/AssertEdit/AssertEditApi.php (deleted) (history)

Diff [purge]

Index: trunk/extensions/AssertEdit/AssertEditApi.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 AssertEditApi 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/ApiAssertEdit.php
@@ -0,0 +1,58 @@
 2+<?php
 3+if ( !defined( 'MEDIAWIKI' ) ) {
 4+ // Eclipse helper - will be ignored in production
 5+ require_once( 'ApiBase.php' );
 6+}
 7+
 8+class AssertEditApi 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+}
Property changes on: trunk/extensions/AssertEdit/ApiAssertEdit.php
___________________________________________________________________
Name: svn:eol-style
160 + native
Name: svn:keywords
261 + Id
Index: trunk/extensions/AssertEdit/AssertEdit.php
@@ -31,8 +31,8 @@
3232 $wgHooks['AlternateEdit'][] = 'efAssertEditHook';
3333 $wgHooks['APIEditBeforeSave'][] = 'efAssertApiEditHook';
3434
35 -$wgAutoloadClasses['AssertEditApi'] = $dir . "AssertEditApi.php";
36 -$wgAPIModules['assertedit'] = 'AssertEditApi';
 35+$wgAutoloadClasses['ApiAssertEdit'] = $dir . "ApiAssertEdit.php";
 36+$wgAPIModules['assertedit'] = 'ApiAssertEdit';
3737
3838 function efAssertEditHook( $editpage ) {
3939 global $wgOut, $wgRequest;

Follow-up revisions

RevisionCommit summaryAuthorDate
r62875Cleanup r62874, also need to rename classdemon13:42, 23 February 2010

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