mediawiki-extensions-Confir.../FancyCaptcha/includes/ApiFancyCaptchaReload.php
Reedy d648372f7f Fix MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic
Change-Id: Idc03460327095e19438fd9a3a542bf4229db4be2
2020-04-15 00:45:00 +01:00

38 lines
750 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();
$info = $captcha->getCaptcha();
$captchaIndex = $captcha->storeCaptcha( $info );
$result = $this->getResult();
$result->addValue( null, $this->getModuleName(), [ 'index' => $captchaIndex ] );
return true;
}
/**
* @inheritDoc
*/
public function getAllowedParams() {
return [];
}
/**
* @see ApiBase::getExamplesMessages()
* @return array
*/
protected function getExamplesMessages() {
return [
'action=fancycaptchareload'
=> 'apihelp-fancycaptchareload-example-1',
];
}
}