mediawiki-extensions-Confir.../FancyCaptcha/includes/ApiFancyCaptchaReload.php
Reedy c47a5aeb49 ApiFancyCaptchaReload: Mark as internal
Change-Id: I3477f762309ff6e276afee0c38d731cb05ed8ed6
(cherry picked from commit b2b1fd4c98)
2024-01-15 17:53:33 +00:00

41 lines
815 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 isInternal() {
return true;
}
/** @inheritDoc */
public function getAllowedParams() {
return [];
}
/**
* @see ApiBase::getExamplesMessages()
* @return array
*/
protected function getExamplesMessages() {
return [
'action=fancycaptchareload'
=> 'apihelp-fancycaptchareload-example-1',
];
}
}