9 abstract public function store( $index, $info );
22 abstract public function clear( $index );
42 final public static function get() {
43 if ( !self::$instance instanceof
self ) {
44 global $wgCaptchaStorageClass;
45 if ( in_array(
'CaptchaStore', class_parents( $wgCaptchaStorageClass ) ) ) {
46 self::$instance =
new $wgCaptchaStorageClass;
48 throw new Exception(
"Invalid CaptchaStore class $wgCaptchaStorageClass" );
55 if ( !defined(
'MW_PHPUNIT_TEST' ) ) {
56 throw new MWException(
'Cannot unset ' . __CLASS__ .
' instance in operation.' );
58 self::$instance =
null;
__construct()
Protected constructor: no creating instances except through the factory method above.
cookiesNeeded()
Whether this type of CaptchaStore needs cookies.
static unsetInstanceForTests()
clear( $index)
Delete a result once the captcha has been used, so it cannot be reused.
static CaptchaStore $instance
The singleton instance.
store( $index, $info)
Store the correct answer for a given captcha.
retrieve( $index)
Retrieve the answer for a given captcha.