MediaWiki REL1_31
CaptchaCacheStore.php
Go to the documentation of this file.
1<?php
2
4 function store( $index, $info ) {
5 global $wgCaptchaSessionExpiration;
6
7 ObjectCache::getMainStashInstance()->set(
8 wfMemcKey( 'captcha', $index ),
9 $info,
10 $wgCaptchaSessionExpiration
11 );
12 }
13
14 function retrieve( $index ) {
15 $info = ObjectCache::getMainStashInstance()->get( wfMemcKey( 'captcha', $index ) );
16 if ( $info ) {
17 return $info;
18 } else {
19 return false;
20 }
21 }
22
23 function clear( $index ) {
24 ObjectCache::getMainStashInstance()->delete( wfMemcKey( 'captcha', $index ) );
25 }
26
27 function cookiesNeeded() {
28 return false;
29 }
30}
wfMemcKey()
Make a cache key for the local wiki.
retrieve( $index)
Retrieve the answer for a given captcha.
clear( $index)
Delete a result once the captcha has been used, so it cannot be reused.
cookiesNeeded()
Whether this type of CaptchaStore needs cookies.
store( $index, $info)
Store the correct answer for a given captcha.