MediaWiki REL1_31
CaptchaSessionStore.php
Go to the documentation of this file.
1<?php
2
4
6 protected function __construct() {
7 // Make sure the session is started
8 SessionManager::getGlobalSession()->persist();
9 }
10
11 function store( $index, $info ) {
12 SessionManager::getGlobalSession()->set( 'captcha' . $index, $info );
13 }
14
15 function retrieve( $index ) {
16 return SessionManager::getGlobalSession()->get( 'captcha' . $index, false );
17 }
18
19 function clear( $index ) {
20 SessionManager::getGlobalSession()->remove( 'captcha' . $index );
21 }
22
23 function cookiesNeeded() {
24 return true;
25 }
26}
__construct()
Protected constructor: no creating instances except through the factory method above.
clear( $index)
Delete a result once the captcha has been used, so it cannot be reused.
cookiesNeeded()
Whether this type of CaptchaStore needs cookies.
retrieve( $index)
Retrieve the answer for a given captcha.
store( $index, $info)
Store the correct answer for a given captcha.
This serves as the entry point to the MediaWiki session handling system.