Page MenuHomeWickedGov Phorge

CaptchaCacheStore.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

CaptchaCacheStore.php

<?php
namespace MediaWiki\Extension\ConfirmEdit\Store;
use MediaWiki\MediaWikiServices;
use Wikimedia\ObjectCache\BagOStuff;
class CaptchaCacheStore extends CaptchaStore {
/** @var BagOStuff */
private $store;
public function __construct() {
parent::__construct();
$this->store = MediaWikiServices::getInstance()->getMicroStash();
}
/**
* @inheritDoc
*/
public function store( $index, $info ) {
global $wgCaptchaSessionExpiration;
$this->store->set(
$this->store->makeKey( 'captcha', $index ),
$info,
$wgCaptchaSessionExpiration,
// Assume the write will reach the master DC before the user sends the
// HTTP POST request attempted to solve the captcha and perform an action
$this->store::WRITE_BACKGROUND
);
}
/**
* @inheritDoc
*/
public function retrieve( $index ) {
return $this->store->get( $this->store->makeKey( 'captcha', $index ) );
}
/**
* @inheritDoc
*/
public function clear( $index ) {
$this->store->delete( $this->store->makeKey( 'captcha', $index ) );
}
public function cookiesNeeded() {
return false;
}
}
class_alias( CaptchaCacheStore::class, 'CaptchaCacheStore' );

File Metadata

Mime Type
text/x-php
Expires
Sat, May 16, 15:32 (14 h, 53 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
eb/16/2394ac74d2176a497e04500d42eb
Default Alt Text
CaptchaCacheStore.php (1 KB)

Event Timeline