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 |
1 | 60 | + native |
Name: svn:keywords |
2 | 61 | + Id |
Index: trunk/extensions/AssertEdit/AssertEdit.php |
— | — | @@ -31,8 +31,8 @@ |
32 | 32 | $wgHooks['AlternateEdit'][] = 'efAssertEditHook'; |
33 | 33 | $wgHooks['APIEditBeforeSave'][] = 'efAssertApiEditHook'; |
34 | 34 | |
35 | | -$wgAutoloadClasses['AssertEditApi'] = $dir . "AssertEditApi.php"; |
36 | | -$wgAPIModules['assertedit'] = 'AssertEditApi'; |
| 35 | +$wgAutoloadClasses['ApiAssertEdit'] = $dir . "ApiAssertEdit.php"; |
| 36 | +$wgAPIModules['assertedit'] = 'ApiAssertEdit'; |
37 | 37 | |
38 | 38 | function efAssertEditHook( $editpage ) { |
39 | 39 | global $wgOut, $wgRequest; |