Zend\Captcha\Figlet
Captcha based on figlet text rendering service
Note that this engine seems not to like numbers
Synopsis
class Figlet
extends AbstractWord
{
- // Inherited constants from AbstractWord
- const MISSING_VALUE = 'missingValue';
- const MISSING_ID = 'missingID';
- const BAD_CAPTCHA = 'badCaptcha';
- // members
- protected Figlet $figlet;
- // Inherited members from AbstractWord
- public array $V;
- public array $VN;
- public array $C;
- public array $CN;
- protected string $id;
- protected string $word;
- protected Container $session;
- protected string $sessionClass;
- protected bool $useNumbers;
- protected integer $timeout;
- protected bool $keepSession;
- protected array $messageTemplates;
- protected integer $wordlen;
- // Inherited members from AbstractAdapter
- protected string $name;
- protected array $options;
- protected array $skipOptions;
- // Inherited members from AbstractValidator
- protected mixed $value;
- protected TranslatorInterface $defaultTranslator;
- protected string $defaultTranslatorTextDomain;
- protected integer $messageLength;
- protected array $abstractOptions;
- // methods
- public void __construct()
- public Figlet getFiglet()
- public string generate()
- public string getHelperName()
- // Inherited methods from AbstractWord
- public string getSessionClass()
- public AbstractWord setSessionClass()
- public int getWordlen()
- public AbstractWord setWordlen()
- public string getId()
- protected AbstractWord setId()
- public AbstractWord setTimeout()
- public int getTimeout()
- public AbstractWord setKeepSession()
- public bool getUseNumbers()
- public AbstractWord setUseNumbers()
- public Container getSession()
- public AbstractWord setSession()
- public string getWord()
- protected AbstractWord setWord()
- protected string generateWord()
- public string generate()
- protected string generateRandomId()
- public bool isValid()
- public string getHelperName()
- // Inherited methods from AbstractAdapter
- public string getName()
- public AbstractAdapter setName()
- public AbstractAdapter setOption()
- public AbstractAdapter setOptions()
- public array getOptions()
- public string getHelperName()
- // Inherited methods from AbstractValidator
- public void __construct()
- public mixed getOption()
- public array getOptions()
- public AbstractValidator setOptions()
- public array getMessages()
- public bool __invoke()
- public array getMessageVariables()
- public array getMessageTemplates()
- public AbstractValidator setMessage()
- public AbstractValidator setMessages()
- public mixed __get()
- protected string createMessage()
- protected void error()
- protected mixed getValue()
- protected void setValue()
- public AbstractValidator setValueObscured()
- public bool isValueObscured()
- public AbstractValidator setTranslator()
- public TranslatorInterface|null getTranslator()
- public bool hasTranslator()
- public AbstractValidator setTranslatorTextDomain()
- public string getTranslatorTextDomain()
- public static void setDefaultTranslator()
- public static TranslatorInterface|null getDefaultTranslator()
- public static bool hasDefaultTranslator()
- public static void setDefaultTranslatorTextDomain()
- public static string getDefaultTranslatorTextDomain()
- public AbstractValidator setTranslatorEnabled()
- public bool isTranslatorEnabled()
- public static int getMessageLength()
- public static void setMessageLength()
- protected string translateMessage()
Hierarchy
Extends
Constants
Name | Value |
---|---|
MISSING_VALUE | 'missingValue' |
MISSING_ID | 'missingID' |
BAD_CAPTCHA | 'badCaptcha' |
Members
protected
- $abstractOptions
- $defaultTranslator
—
Zend\Validator\Translator\TranslatorInterface
Default translation object for all validate objects - $defaultTranslatorTextDomain
—
string
Default text domain to be used with translator - $figlet
—
Zend\Text\Figlet\Figlet
Figlet text renderer - $id
—
string
Random session ID - $keepSession
—
Zend\Captcha\bool
Should generate() keep session or create a new one? - $messageLength
—
int
Limits the maximum returned length of an error message - $messageTemplates
—
array
Error messages - $name
—
string
Captcha name - $options
—
array
Captcha options - $session
—
Zend\Session\Container
Session - $sessionClass
—
string
Class name for sessions - $skipOptions
—
array
Options to skip when processing options - $timeout
—
int
Session lifetime for the captcha data - $useNumbers
—
Zend\Captcha\bool
Should the numbers be used or only letters - $value
—
mixed
The value to be validated - $word
—
string
Generated word - $wordlen
—
int
Length of the word to generate
public
- $C
- $CN
- $V
- $VN
Methods
public
- __construct() — Constructor
- generate() — Generate new captcha
- getFiglet() — Retrieve the composed figlet manager
- getHelperName() — Get helper name used to render captcha
Inherited from Zend\Captcha\AbstractWord
protected
- generateRandomId() — Generate a random identifier
- generateWord() — Generate new random word
- setId() — Set captcha identifier
- setWord() — Set captcha word
public
- generate() — Generate new session ID and new word
- getHelperName() — Get helper name used to render captcha
- getId() — Retrieve captcha ID
- getSession() — Get session object
- getSessionClass() — Retrieve session class to utilize
- getTimeout() — Get session token timeout
- getUseNumbers() — Numbers should be included in the pattern?
- getWord() — Get captcha word
- getWordlen() — Retrieve word length to use when generating captcha
- isValid() — Validate the word
- setKeepSession() — Sets if session should be preserved on generate()
- setSession() — Set session namespace object
- setSessionClass() — Set session class for persistence
- setTimeout() — Set timeout for session token
- setUseNumbers() — Set if numbers should be included in the pattern
- setWordlen() — Set word length of captcha
Inherited from Zend\Captcha\AbstractAdapter
public
- getHelperName() — Get helper name used to render captcha
- getName() — Get name
- getOptions() — Retrieve options representing object state
- setName() — Set name
- setOption() — Set single option for the object
- setOptions() — Set object state from options array
Inherited from Zend\Validator\AbstractValidator
protected
- createMessage() — Constructs and returns a validation failure message with the given message key and value.
- error()
- getValue() — Returns the validation value
- setValue() — Sets the value to be validated and clears the messages and errors arrays
- translateMessage() — Translate a validation message
public
- __get() — Magic function returns the value of the requested property, if and only if it is the value or a message variable.
- __invoke() — Invoke as command
- getDefaultTranslator() — Get default translation object for all validate objects
- getDefaultTranslatorTextDomain() — Get default translation text domain for all validate objects
- getMessageLength() — Returns the maximum allowed message length
- getMessageTemplates() — Returns the message templates from the validator
- getMessageVariables() — Returns an array of the names of variables that are used in constructing validation failure messages
- getMessages() — Returns array of validation failure messages
- getOption() — Returns an option
- getOptions() — Returns all available options
- getTranslator() — Return translation object
- getTranslatorTextDomain() — Return the translation text domain
- hasDefaultTranslator() — Is there a default translation object set?
- hasTranslator() — Does this validator have its own specific translator?
- isTranslatorEnabled() — Is translation enabled?
- isValueObscured() — Retrieve flag indicating whether or not value should be obfuscated in messages
- setDefaultTranslator() — Set default translation object for all validate objects
- setDefaultTranslatorTextDomain() — Set default translation text domain for all validate objects
- setMessage() — Sets the validation failure message template for a particular key
- setMessageLength() — Sets the maximum allowed message length
- setMessages() — Sets validation failure message templates given as an array, where the array keys are the message keys, and the array values are the message template strings.
- setOptions() — Sets one or multiple options
- setTranslator() — Set translation object
- setTranslatorEnabled() — Indicate whether or not translation should be enabled
- setTranslatorTextDomain() — Set translation text domain
- setValueObscured() — Set flag indicating whether or not value should be obfuscated in messages