mediawiki-extensions-Confir.../FancyCaptcha/includes/ApiFancyCaptchaReload.php
Reedy 635154c441 ApiFancyCaptchaReload: Mark as internal
Change-Id: I3477f762309ff6e276afee0c38d731cb05ed8ed6
(cherry picked from commit b2b1fd4c98)
2024-01-15 17:53:15 +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',
];
}
}