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

49 lines
871 B
PHP

<?php
use MediaWiki\MediaWikiServices;
class CaptchaCacheStore extends CaptchaStore {
/** @var BagOStuff */
private $cache;
public function __construct() {
parent::__construct();
$this->cache = MediaWikiServices::getInstance()->getMainObjectStash();
}
/**
* @inheritDoc
*/
public function store( $index, $info ) {
global $wgCaptchaSessionExpiration;
$cache = $this->cache;
$cache->set(
$cache->makeKey( 'captcha', $index ),
$info,
$wgCaptchaSessionExpiration
);
}
/**
* @inheritDoc
*/
public function retrieve( $index ) {
$cache = $this->cache;
return $cache->get( $cache->makeKey( 'captcha', $index ) ) ?: false;
}
/**
* @inheritDoc
*/
public function clear( $index ) {
$cache = $this->cache;
$cache->delete( $cache->makeKey( 'captcha', $index ) );
}
public function cookiesNeeded() {
return false;
}
}