2017-12-16 12:32:46 +00:00
|
|
|
<?php
|
|
|
|
|
2022-04-08 16:40:15 +00:00
|
|
|
namespace MediaWiki\Extension\ConfirmEdit\Store;
|
|
|
|
|
2017-12-16 12:32:46 +00:00
|
|
|
class CaptchaHashStore extends CaptchaStore {
|
2024-08-19 19:36:23 +00:00
|
|
|
/** @var array */
|
2017-12-16 12:32:46 +00:00
|
|
|
protected $data = [];
|
|
|
|
|
2020-04-14 23:29:18 +00:00
|
|
|
/**
|
|
|
|
* @inheritDoc
|
|
|
|
*/
|
2017-12-16 12:32:46 +00:00
|
|
|
public function store( $index, $info ) {
|
|
|
|
$this->data[$index] = $info;
|
|
|
|
}
|
|
|
|
|
2020-04-14 23:29:18 +00:00
|
|
|
/**
|
|
|
|
* @inheritDoc
|
|
|
|
*/
|
2017-12-16 12:32:46 +00:00
|
|
|
public function retrieve( $index ) {
|
|
|
|
if ( array_key_exists( $index, $this->data ) ) {
|
|
|
|
return $this->data[$index];
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-04-14 23:29:18 +00:00
|
|
|
/**
|
|
|
|
* @inheritDoc
|
|
|
|
*/
|
2017-12-16 12:32:46 +00:00
|
|
|
public function clear( $index ) {
|
|
|
|
unset( $this->data[$index] );
|
|
|
|
}
|
|
|
|
|
|
|
|
public function cookiesNeeded() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function clearAll() {
|
|
|
|
$this->data = [];
|
|
|
|
}
|
|
|
|
}
|