2017-12-16 12:32:46 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class CaptchaHashStore extends CaptchaStore {
|
|
|
|
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 = [];
|
|
|
|
}
|
|
|
|
}
|