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 |
Definition at line 32 of file axCaptcha.class.php.
axCaptcha::__construct | ( | array $ | options = array() | ) |
Constructor.
array | $config | [optional] [default array() ] The configuration |
Definition at line 56 of file axCaptcha.class.php.
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.
string | $path | The dictionnary path |
RuntimeException | If the file cannot be parsed |
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.
string | $lang | The question language |
axMissingFileException | If the dictionnary file doesn't exists |
RuntimeException | If the given langugage is not found in the dictionnary |
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.
string | $answer | The input field provided by the form |
Definition at line 142 of file axCaptcha.class.php.
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.