summaryrefslogtreecommitdiff
path: root/extensions/ConfirmEdit/FancyCaptcha/ApiFancyCaptchaReload.php
blob: 8cd28631a0932e9f23f0fc36254d487915ed95b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
 * Api module to reload FancyCaptcha
 *
 * @ingroup API
 * @ingroup Extensions
 */
class ApiFancyCaptchaReload extends ApiBase {
	public function execute() {
		# Get a new FancyCaptcha form data
		$captcha = new FancyCaptcha();
		$captchaIndex = $captcha->getCaptchaIndex();

		$result = $this->getResult();
		$result->addValue( null, $this->getModuleName(), array ( 'index' => $captchaIndex ) );
		return true;
	}

	/**
	 * @deprecated since MediaWiki core 1.25
	 */
	public function getDescription() {
		return 'Get a new FancyCaptcha.';
	}

	public function getAllowedParams() {
		return array();
	}

	/**
	 * @deprecated since MediaWiki core 1.25
	 */
	public function getExamples() {
		return array( 'api.php?action=fancycaptchareload&format=xml' );
	}

	/**
	 * @see ApiBase::getExamplesMessages()
	 */
	protected function getExamplesMessages() {
		return array(
			'action=fancycaptchareload'
				=> 'apihelp-fancycaptchareload-example-1',
		);
	}
}