mediawiki-extensions-Confir.../FancyCaptcha/ApiFancyCaptchaReload.php
Kunal Mehta 9ea898ba2a build: Updating mediawiki/mediawiki-codesniffer to 0.7.1
Also added "composer fix" command.

Change-Id: Ibda3fd002c577c7f7c41920d67ec44fedbd27cb8
2016-05-09 16:41:17 -07:00

47 lines
946 B
PHP

<?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(), [ 'index' => $captchaIndex ] );
return true;
}
/**
* @deprecated since MediaWiki core 1.25
*/
public function getDescription() {
return 'Get a new FancyCaptcha.';
}
public function getAllowedParams() {
return [];
}
/**
* @deprecated since MediaWiki core 1.25
*/
public function getExamples() {
return [ 'api.php?action=fancycaptchareload&format=xml' ];
}
/**
* @see ApiBase::getExamplesMessages()
*/
protected function getExamplesMessages() {
return [
'action=fancycaptchareload'
=> 'apihelp-fancycaptchareload-example-1',
];
}
}