mediawiki-extensions-Confir.../FancyCaptcha/includes/ApiFancyCaptchaReload.php
Umherirrender 1cfba87b23 Use namespaced classes
Changes to the use statements done automatically via script
Addition of missing use statement done manually

Change-Id: I60968f9b735b27eaef20e5d42af322a8c2ecd257
2024-10-19 23:34:41 +02:00

46 lines
901 B
PHP

<?php
namespace MediaWiki\Extension\ConfirmEdit\FancyCaptcha;
use MediaWiki\Api\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',
];
}
}