mediawiki-extensions-Confir.../FancyCaptcha/includes/ApiFancyCaptchaReload.php
Reedy b2b1fd4c98 ApiFancyCaptchaReload: Mark as internal
Change-Id: I3477f762309ff6e276afee0c38d731cb05ed8ed6
2024-01-15 17:24:36 +00:00

46 lines
887 B
PHP

<?php
namespace MediaWiki\Extension\ConfirmEdit\FancyCaptcha;
use ApiBase;
/**
* 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 isInternal() {
return true;
}
/** @inheritDoc */
public function getAllowedParams() {
return [];
}
/**
* @see ApiBase::getExamplesMessages()
* @return array
*/
protected function getExamplesMessages() {
return [
'action=fancycaptchareload'
=> 'apihelp-fancycaptchareload-example-1',
];
}
}