Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 5 |
|
0.00% |
0 / 5 |
CRAP | |
0.00% |
0 / 1 |
CaptchaSessionStore | |
0.00% |
0 / 5 |
|
0.00% |
0 / 5 |
30 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
store | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
retrieve | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
clear | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
cookiesNeeded | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Extension\ConfirmEdit\Store; |
4 | |
5 | use MediaWiki\Session\SessionManager; |
6 | |
7 | class CaptchaSessionStore extends CaptchaStore { |
8 | protected function __construct() { |
9 | // Make sure the session is started |
10 | SessionManager::getGlobalSession()->persist(); |
11 | } |
12 | |
13 | /** |
14 | * @inheritDoc |
15 | */ |
16 | public function store( $index, $info ) { |
17 | SessionManager::getGlobalSession()->set( 'captcha' . $index, $info ); |
18 | } |
19 | |
20 | /** |
21 | * @inheritDoc |
22 | */ |
23 | public function retrieve( $index ) { |
24 | return SessionManager::getGlobalSession()->get( 'captcha' . $index, false ); |
25 | } |
26 | |
27 | /** |
28 | * @inheritDoc |
29 | */ |
30 | public function clear( $index ) { |
31 | SessionManager::getGlobalSession()->remove( 'captcha' . $index ); |
32 | } |
33 | |
34 | public function cookiesNeeded() { |
35 | return true; |
36 | } |
37 | } |