API Documentation

Captcha/Figlet.php

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Captcha  
subpackage
Adapter  

\Zend_Captcha_Figlet

Captcha based on figlet text rendering service

Note that this engine seems not to like numbers

Extends from
\Zend_Captcha_Word
category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Captcha  
subpackage
Adapter  
version
$Id: Figlet.php 23775 2011-03-01 17:25:24Z ralph $  

Properties

Propertyprotected\Zend_Text_Figlet  $_figlet= ''

Figlet text renderer

Details
Type
\Zend_Text_Figlet

Methods

methodpublic__construct( null|string|array|\Zend_Config $options = null ) : void

Constructor

Parameters
Name Type Description
$options null|string|array|\Zend_Config
methodpublic__get( string $property ) : mixed

Magic function returns the value of the requested property, if and only if it is the value or a message variable.

Inherited from: \Zend_Validate_Abstract::__get()
Parameters
Name Type Description
$property string
Returns
Type Description
mixed
Throws
Exception Description
\Zend_Validate_Exception
methodprotected_createMessage( string $messageKey, string $value ) : string

Constructs and returns a validation failure message with the given message key and value.

Inherited from: \Zend_Validate_Abstract::_createMessage()

Returns null if and only if $messageKey does not correspond to an existing template.

If a translator is available and a translation exists for $messageKey, the translation will be used.

Parameters
Name Type Description
$messageKey string
$value string
Returns
Type Description
string
methodprotected_error( string $messageKey, string $value = null ) : void
Parameters
Name Type Description
$messageKey string
$value string OPTIONAL
methodprotected_generateRandomId( ) : void
methodprotected_generateWord( ) : string

Generate new random word

Inherited from: \Zend_Captcha_Word::_generateWord()
Returns
Type Description
string
methodprotected_setId( string $id ) : void

Set captcha identifier

Inherited from: \Zend_Captcha_Word::_setId()
Parameters
Name Type Description
$id string return Zend_Captcha_Word
methodprotected_setValue( mixed $value ) : void

Sets the value to be validated and clears the messages and errors arrays

Inherited from: \Zend_Validate_Abstract::_setValue()
Parameters
Name Type Description
$value mixed
methodprotected_setWord( string $word ) : \Zend_Captcha_Word

Set captcha word

Inherited from: \Zend_Captcha_Word::_setWord()
Parameters
Name Type Description
$word string
Returns
Type Description
\Zend_Captcha_Word
methodpublicgenerate( ) : string

Generate new captcha

Returns
Type Description
string
methodpublicgetDecorator( ) : string

Get captcha decorator

Inherited from: \Zend_Captcha_Word::getDecorator()

By default, return null, indicating no extra decorator needed.

Returns
Type Description
string
methodpublicgetDefaultTranslator( ) : \Zend_Translate_Adapter|null
static

Get default translation object for all validate objects

Inherited from: \Zend_Validate_Abstract::getDefaultTranslator()
Returns
Type Description
\Zend_Translate_Adapternull
methodpublicgetErrors( ) : array

Returns array of validation failure message codes

Inherited from: \Zend_Validate_Abstract::getErrors()
Returns
Type Description
array
Details
deprecated
Since 1.5.0  
methodpublicgetId( ) : string

Retrieve captcha ID

Inherited from: \Zend_Captcha_Word::getId()
Returns
Type Description
string
methodpublicgetMessageLength( ) : integer
static

Returns the maximum allowed message length

Inherited from: \Zend_Validate_Abstract::getMessageLength()
Returns
Type Description
integer
methodpublicgetMessageTemplates( ) : array

Returns the message templates from the validator

Inherited from: \Zend_Validate_Abstract::getMessageTemplates()
Returns
Type Description
array
methodpublicgetMessageVariables( ) : array

Returns an array of the names of variables that are used in constructing validation failure messages

Inherited from: \Zend_Validate_Abstract::getMessageVariables()
Returns
Type Description
array
methodpublicgetMessages( ) : array

Returns array of validation failure messages

Inherited from: \Zend_Validate_Abstract::getMessages()

If isValid() was never called or if the most recent isValid() call returned true, then this method returns an empty array.

Returns
Type Description
array
methodpublicgetName( ) : string

Get name

Inherited from: \Zend_Captcha_Base::getName()
Returns
Type Description
string
methodpublicgetObscureValue( ) : bool

Retrieve flag indicating whether or not value should be obfuscated in messages

Inherited from: \Zend_Validate_Abstract::getObscureValue()
Returns
Type Description
bool
methodpublicgetOptions( ) : array

Retrieve options representing object state

Inherited from: \Zend_Captcha_Base::getOptions()
Returns
Type Description
array
methodpublicgetSession( ) : \Zend_Session_Namespace

Get session object

Inherited from: \Zend_Captcha_Word::getSession()
Returns
Type Description
\Zend_Session_Namespace
methodpublicgetSessionClass( ) : string

Retrieve session class to utilize

Inherited from: \Zend_Captcha_Word::getSessionClass()
Returns
Type Description
string
methodpublicgetTimeout( ) : int

Get session token timeout

Inherited from: \Zend_Captcha_Word::getTimeout()
Returns
Type Description
int
methodpublicgetTranslator( ) : \Zend_Translate_Adapter|null

Return translation object

Inherited from: \Zend_Validate_Abstract::getTranslator()
Returns
Type Description
\Zend_Translate_Adapternull
methodpublicgetUseNumbers( ) : bool

Numbers should be included in the pattern?

Inherited from: \Zend_Captcha_Word::getUseNumbers()
Returns
Type Description
bool
methodpublicgetWord( ) : string

Get captcha word

Inherited from: \Zend_Captcha_Word::getWord()
Returns
Type Description
string
methodpublicgetWordlen( ) : integer

Retrieve word length to use when genrating captcha

Inherited from: \Zend_Captcha_Word::getWordlen()
Returns
Type Description
integer
methodpublichasDefaultTranslator( ) : boolean
static

Is there a default translation object set?

Inherited from: \Zend_Validate_Abstract::hasDefaultTranslator()
Returns
Type Description
boolean
methodpublichasTranslator( ) : bool

Does this validator have its own specific translator?

Inherited from: \Zend_Validate_Abstract::hasTranslator()
Returns
Type Description
bool
methodpublicisValid( mixed $value,  $context = null ) : boolean

Validate the word

Inherited from: \Zend_Captcha_Word::isValid()

If $value fails validation, then this method returns false, and getMessages() will return an array of messages that explain why the validation failed.

Parameters
Name Type Description
$value mixed
$context
Returns
Type Description
boolean
Throws
Exception Description
\Zend_Validate_Exception If validation of $value is impossible
Details
see
\Zend_Validate_Interface::isValid()  
methodpublicrender( \Zend_View_Interface $view = null, mixed $element = null ) : string

Display the captcha

Parameters
Name Type Description
$view \Zend_View_Interface
$element mixed
Returns
Type Description
string
methodpublicsetConfig( \Zend_Config $config ) : \Zend_Captcha_Base

Set object state from config object

Inherited from: \Zend_Captcha_Base::setConfig()
Parameters
Name Type Description
$config \Zend_Config
Returns
Type Description
\Zend_Captcha_Base
methodpublicsetDefaultTranslator( \Zend_Translate|\Zend_Translate_Adapter|null $translator = null ) : void
static

Set default translation object for all validate objects

Inherited from: \Zend_Validate_Abstract::setDefaultTranslator()
Parameters
Name Type Description
$translator \Zend_Translate|\Zend_Translate_Adapter|null
methodpublicsetDisableTranslator( bool $flag ) : \Zend_Validate_Abstract

Indicate whether or not translation should be disabled

Inherited from: \Zend_Validate_Abstract::setDisableTranslator()
Parameters
Name Type Description
$flag bool
Returns
Type Description
\Zend_Validate_Abstract
methodpublicsetKeepSession( bool $keepSession ) : \Zend_Captcha_Word

Sets if session should be preserved on generate()

Inherited from: \Zend_Captcha_Word::setKeepSession()
Parameters
Name Type Description
$keepSession bool

Should session be kept on generate()?

Returns
Type Description
\Zend_Captcha_Word
methodpublicsetMessage( string $messageString, string $messageKey = null ) : \Zend_Validate_Abstract

Sets the validation failure message template for a particular key

Inherited from: \Zend_Validate_Abstract::setMessage()
Parameters
Name Type Description
$messageString string
$messageKey string OPTIONAL
Returns
Type Description
\Zend_Validate_Abstract Provides a fluent interface
Throws
Exception Description
\Zend_Validate_Exception
methodpublicsetMessageLength( integer $length ) : void
static

Sets the maximum allowed message length

Inherited from: \Zend_Validate_Abstract::setMessageLength()
Parameters
Name Type Description
$length integer
methodpublicsetMessages( array $messages ) : \Zend_Validate_Abstract

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.

Inherited from: \Zend_Validate_Abstract::setMessages()
Parameters
Name Type Description
$messages array
Returns
Type Description
\Zend_Validate_Abstract
methodpublicsetName( string $name ) : \Zend_Captcha_Adapter

Set name

Inherited from: \Zend_Captcha_Base::setName()
Parameters
Name Type Description
$name string
Returns
Type Description
\Zend_Captcha_Adapter
methodpublicsetObscureValue( bool $flag ) : \Zend_Validate_Abstract

Set flag indicating whether or not value should be obfuscated in messages

Inherited from: \Zend_Validate_Abstract::setObscureValue()
Parameters
Name Type Description
$flag bool
Returns
Type Description
\Zend_Validate_Abstract
methodpublicsetOption( string $key, string $value ) : \Zend_Form_Element

Set single option for the object

Inherited from: \Zend_Captcha_Base::setOption()
Parameters
Name Type Description
$key string
$value string
Returns
Type Description
\Zend_Form_Element
methodpublicsetOptions( array $options = null ) : \Zend_Form_Element

Set object state from options array

Inherited from: \Zend_Captcha_Base::setOptions()
Parameters
Name Type Description
$options array
Returns
Type Description
\Zend_Form_Element
methodpublicsetSession( \Zend_Session_Namespace $session ) : \Zend_Captcha_Word

Set session namespace object

Inherited from: \Zend_Captcha_Word::setSession()
Parameters
Name Type Description
$session \Zend_Session_Namespace
Returns
Type Description
\Zend_Captcha_Word
methodpublicsetSessionClass( string $_sessionClass ) : \Zend_Captcha_Word

Set session class for persistence

Inherited from: \Zend_Captcha_Word::setSessionClass()
Parameters
Name Type Description
$_sessionClass string
Returns
Type Description
\Zend_Captcha_Word
methodpublicsetTimeout( int $ttl ) : \Zend_Captcha_Word

Set timeout for session token

Inherited from: \Zend_Captcha_Word::setTimeout()
Parameters
Name Type Description
$ttl int
Returns
Type Description
\Zend_Captcha_Word
methodpublicsetTranslator( \Zend_Translate|\Zend_Translate_Adapter|null $translator = null ) : \Zend_Validate_Abstract

Set translation object

Inherited from: \Zend_Validate_Abstract::setTranslator()
Parameters
Name Type Description
$translator \Zend_Translate|\Zend_Translate_Adapter|null
Returns
Type Description
\Zend_Validate_Abstract
methodpublicsetUseNumbers( bool $_useNumbers ) : \Zend_Captcha_Word

Set if numbers should be included in the pattern

Inherited from: \Zend_Captcha_Word::setUseNumbers()
Parameters
Name Type Description
$_useNumbers bool

numbers should be included in the pattern?

Returns
Type Description
\Zend_Captcha_Word
methodpublicsetWordlen( integer $wordlen ) : \Zend_Captcha_Word

Set word length of captcha

Inherited from: \Zend_Captcha_Word::setWordlen()
Parameters
Name Type Description
$wordlen integer
Returns
Type Description
\Zend_Captcha_Word
methodpublictranslatorIsDisabled( ) : bool

Is translation disabled?

Inherited from: \Zend_Validate_Abstract::translatorIsDisabled()
Returns
Type Description
bool
Documentation was generated by DocBlox 0.13.3.