Axiom (v1.2.0)

A lightweight PHP framework
axCaptcha Class Reference

Public Member Functions

 __construct (array $options=array())
 Constructor.
 generate ($lang)
 Generates a captcha for the given lang.
 verify ($answer)
 Verify the answer agains the last generated question.

Protected Member Functions

 _parseDictionnary ($path)
 Parses the dictionnary pointed by $path and saves the parse results in class cache.

Protected Attributes

 $_options
 Internal configuration.
 $_dictionnary_struct
 $_session
 axSession handle

Detailed Description

Definition at line 32 of file axCaptcha.class.php.


Constructor & Destructor Documentation

axCaptcha::__construct ( array $  options = array())

Constructor.

Parameters:
array$config[optional] [default array()] The configuration

Definition at line 56 of file axCaptcha.class.php.


Member Function Documentation

axCaptcha::_parseDictionnary ( path) [protected]

Parses the dictionnary pointed by $path and saves the parse results in class cache.

The dictionnary file will be parsed using PHP parse_ini_file.

Parameters:
string$pathThe dictionnary path
Exceptions:
RuntimeExceptionIf the file cannot be parsed
Returns:
void

Definition at line 76 of file axCaptcha.class.php.

axCaptcha::generate ( lang)

Generates a captcha for the given lang.

Returns the question after storing the answer in session for next use.

Parameters:
string$langThe question language
Exceptions:
axMissingFileExceptionIf the dictionnary file doesn't exists
RuntimeExceptionIf the given langugage is not found in the dictionnary
Returns:
string

Definition at line 91 of file axCaptcha.class.php.

axCaptcha::verify ( answer)

Verify the answer agains the last generated question.

Return true if the provided answer match any of possible question results.

See also:
axCaptcha::generate
Parameters:
string$answerThe input field provided by the form
Returns:
boolean

Definition at line 142 of file axCaptcha.class.php.


Field Documentation

axCaptcha::$_dictionnary_struct [protected]

Definition at line 44 of file axCaptcha.class.php.

array axCaptcha::$_options [protected]

Internal configuration.

Definition at line 38 of file axCaptcha.class.php.

axSession axCaptcha::$_session [protected]

axSession handle

Definition at line 50 of file axCaptcha.class.php.


The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables