Captcha/Image.php

Show: inherited
Table of Contents

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 [email protected] so we can send you a copy immediately.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Captcha  
Subpackage
Adapter  
Version
$Id: Image.php 24821 2012-05-29 14:54:50Z adamlundrigan $  

\Zend_Captcha_Image

Package: Zend\Captcha\Adapter

Image-based captcha element

Generates image displaying random word

Parent(s)
\Zend_Captcha_Word < \Zend_Captcha_Base < \Zend_Validate_Abstract
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Version
$Id: Word.php 24593 2012-01-05 20:35:02Z matthew $  

Constants

Constant  MISSING_VALUE = 'missingValue'
inheritedInherited from: \Zend_Captcha_Word::MISSING_VALUE
Constant  MISSING_ID = 'missingID'
inheritedInherited from: \Zend_Captcha_Word::MISSING_ID
Inherited_from
\Zend_Captcha_Word::MISSING_ID  
Constant  BAD_CAPTCHA = 'badCaptcha'
inheritedInherited from: \Zend_Captcha_Word::BAD_CAPTCHA

Properties

Propertypublic$C = array("b", "c", "d", "f", "g", "h", "j", "k", "m", "n", "p", "q", "r", "s", "t", "u", "v", "w", "x", "z")
staticinheritedInherited from: \Zend_Captcha_Word::$$C
Default valuearray("b", "c", "d", "f", "g", "h", "j", "k", "m", "n", "p", "q", "r", "s", "t", "u", "v", "w", "x", "z")Details
Type
n/a
Inherited_from
\Zend_Captcha_Word::$$C  
Propertypublic$CN = array("b", "c", "d", "f", "g", "h", "j", "k", "m", "n", "p", "q", "r", "s", "t", "u", "v", "w", "x", "z", "2", "3", "4", "5", "6", "7", "8", "9")
staticinheritedInherited from: \Zend_Captcha_Word::$$CN
Default valuearray("b", "c", "d", "f", "g", "h", "j", "k", "m", "n", "p", "q", "r", "s", "t", "u", "v", "w", "x", "z", "2", "3", "4", "5", "6", "7", "8", "9")Details
Type
n/a
Inherited_from
\Zend_Captcha_Word::$$CN  
Propertypublic$V = array("a", "e", "i", "o", "u", "y")
staticinheritedInherited from: \Zend_Captcha_Word::$$V
Default valuearray("a", "e", "i", "o", "u", "y")Details
Type
n/a
Inherited_from
\Zend_Captcha_Word::$$V  
Propertypublic$VN = array("a", "e", "i", "o", "u", "y", "2", "3", "4", "5", "6", "7", "8", "9")
staticinheritedInherited from: \Zend_Captcha_Word::$$VN
Default valuearray("a", "e", "i", "o", "u", "y", "2", "3", "4", "5", "6", "7", "8", "9")Details
Type
n/a
Inherited_from
\Zend_Captcha_Word::$$VN  
Propertyprotected\Zend_Translate $_defaultTranslator =
staticinherited

Default translation object for all validate objects

Inherited from: \Zend_Validate_Abstract::$$_defaultTranslator\Zend_Captcha_Base::$$_defaultTranslator\Zend_Captcha_Word::$$_defaultTranslator
Propertyprotectedint $_dotNoiseLevel = 100

Number of noise dots on image Used twice - before and after transform

Default value100Details
Type
int
Propertyprotectedarray $_errors = array()
inherited

Array of validation failure message codes

Inherited from: \Zend_Validate_Abstract::$$_errors\Zend_Captcha_Base::$$_errors\Zend_Captcha_Word::$$_errors
Default valuearray()Details
Type
array
Inherited_from
\Zend_Validate_Abstract::$$_errors  
Inherited_from
\Zend_Captcha_Base::$$_errors  
Inherited_from
\Zend_Captcha_Word::$$_errors  
Propertyprotectedint $_expiration = 600

How long to keep generated images

Default value600Details
Type
int
Propertyprotectedstring $_font =

Image font file

Details
Type
string
Propertyprotectedint $_fsize = 24

Font size

Default value24Details
Type
int
Propertyprotectedint $_gcFreq = 10

How frequently to execute garbage collection

Default value10Details
Type
int
Propertyprotectedint $_height = 50

Image height

Default value50Details
Type
int
Propertyprotectedstring $_id =
inherited

Random session ID

Inherited from: \Zend_Captcha_Word::$$_id
Details
Type
string
Inherited_from
\Zend_Captcha_Word::$$_id  
Propertyprotectedstring $_imgAlt = ""

Image's alt tag content

Default value""Details
Type
string
Propertyprotectedstring $_imgDir = "./images/captcha/"

Directory for generated images

Default value"./images/captcha/"Details
Type
string
Propertyprotectedstring $_imgUrl = "/images/captcha/"

URL for accessing images

Default value"/images/captcha/"Details
Type
string
Propertyprotectedboolean $_keepSession = false
inherited

Should generate() keep session or create a new one?

Inherited from: \Zend_Captcha_Word::$$_keepSession
Default valuefalseDetails
Type
boolean
Inherited_from
\Zend_Captcha_Word::$$_keepSession  
Propertyprotectedint $_lineNoiseLevel = 5

Number of noise lines on image Used twice - before and after transform

Default value5Details
Type
int
PropertyprotectedInteger $_messageLength = -1
staticinherited

Limits the maximum returned length of a error message

Inherited from: \Zend_Validate_Abstract::$$_messageLength\Zend_Captcha_Base::$$_messageLength\Zend_Captcha_Word::$$_messageLength
Default value-1Details
Type
Integer
Inherited_from
\Zend_Validate_Abstract::$$_messageLength  
Inherited_from
\Zend_Captcha_Base::$$_messageLength  
Inherited_from
\Zend_Captcha_Word::$$_messageLength  
Propertyprotectedarray $_messageTemplates = array(self::MISSING_VALUE => 'Empty captcha value', self::MISSING_ID => 'Captcha ID field is missing', self::BAD_CAPTCHA => 'Captcha value is wrong')
inherited

Error messages

Inherited from: \Zend_Captcha_Word::$$_messageTemplates
Default valuearray(self::MISSING_VALUE => 'Empty captcha value', self::MISSING_ID => 'Captcha ID field is missing', self::BAD_CAPTCHA => 'Captcha value is wrong')Details
Type
array
Inherited_from
\Zend_Captcha_Word::$$_messageTemplates  
Propertyprotectedarray $_messageVariables = array()
inherited

Additional variables available for validation failure messages

Inherited from: \Zend_Validate_Abstract::$$_messageVariables\Zend_Captcha_Base::$$_messageVariables\Zend_Captcha_Word::$$_messageVariables
Default valuearray()Details
Type
array
Inherited_from
\Zend_Validate_Abstract::$$_messageVariables  
Inherited_from
\Zend_Captcha_Base::$$_messageVariables  
Inherited_from
\Zend_Captcha_Word::$$_messageVariables  
Propertyprotectedarray $_messages = array()
Default valuearray()Details
Type
array
Inherited_from
\Zend_Validate_Abstract::$$_messages  
Inherited_from
\Zend_Captcha_Base::$$_messages  
Inherited_from
\Zend_Captcha_Word::$$_messages  
Propertyprotectedstring $_name =
inherited

Element name

Inherited from: \Zend_Captcha_Base::$$_name\Zend_Captcha_Word::$$_name

Useful to generate/check form fields

Details
Type
string
Inherited_from
\Zend_Captcha_Base::$$_name  
Inherited_from
\Zend_Captcha_Word::$$_name  
Propertyprotectedbool $_obscureValue = false
inherited

Flag indidcating whether or not value should be obfuscated in error messages

Inherited from: \Zend_Validate_Abstract::$$_obscureValue\Zend_Captcha_Base::$$_obscureValue\Zend_Captcha_Word::$$_obscureValue
Default valuefalseDetails
Type
bool
Inherited_from
\Zend_Validate_Abstract::$$_obscureValue  
Inherited_from
\Zend_Captcha_Base::$$_obscureValue  
Inherited_from
\Zend_Captcha_Word::$$_obscureValue  
Propertyprotectedarray $_options = array()
inherited

Captcha options

Inherited from: \Zend_Captcha_Base::$$_options\Zend_Captcha_Word::$$_options
Default valuearray()Details
Type
array
Inherited_from
\Zend_Captcha_Base::$$_options  
Inherited_from
\Zend_Captcha_Word::$$_options  
Propertyprotected\Zend_Session_Namespace $_session =
inherited

Session

Inherited from: \Zend_Captcha_Word::$$_session
Propertyprotectedstring $_sessionClass = 'Zend_Session_Namespace'
inherited

Class name for sessions

Inherited from: \Zend_Captcha_Word::$$_sessionClass
Default value'Zend_Session_Namespace'Details
Type
string
Inherited_from
\Zend_Captcha_Word::$$_sessionClass  
Propertyprotectedarray $_skipOptions = array('options', 'config')
inherited

Options to skip when processing options

Inherited from: \Zend_Captcha_Base::$$_skipOptions\Zend_Captcha_Word::$$_skipOptions
Default valuearray('options', 'config')Details
Type
array
Inherited_from
\Zend_Captcha_Base::$$_skipOptions  
Inherited_from
\Zend_Captcha_Word::$$_skipOptions  
Propertyprotectedstring $_startImage =

Image to use as starting point Default is blank image.

If provided, should be PNG image.

Details
Type
string
Propertyprotectedstring $_suffix = ".png"

Image suffix (including dot)

Default value".png"Details
Type
string
Propertyprotectedinteger $_timeout = 300
inherited

Session lifetime for the captcha data

Inherited from: \Zend_Captcha_Word::$$_timeout
Default value300Details
Type
integer
Inherited_from
\Zend_Captcha_Word::$$_timeout  
PropertyprotectedBoolean $_translatorDisabled = false
Default valuefalseDetails
Type
Boolean
Inherited_from
\Zend_Validate_Abstract::$$_translatorDisabled  
Inherited_from
\Zend_Captcha_Base::$$_translatorDisabled  
Inherited_from
\Zend_Captcha_Word::$$_translatorDisabled  
Propertyprotectedboolean $_useNumbers = true
inherited

Should the numbers be used or only letters

Inherited from: \Zend_Captcha_Word::$$_useNumbers
Default valuetrueDetails
Type
boolean
Inherited_from
\Zend_Captcha_Word::$$_useNumbers  
Propertyprotectedmixed $_value =
Details
Type
mixed
Inherited_from
\Zend_Validate_Abstract::$$_value  
Inherited_from
\Zend_Captcha_Base::$$_value  
Inherited_from
\Zend_Captcha_Word::$$_value  
Propertyprotectedint $_width = 200

Image width

Default value200Details
Type
int
Propertyprotectedstring $_word =
inherited

Generated word

Inherited from: \Zend_Captcha_Word::$$_word
Details
Type
string
Inherited_from
\Zend_Captcha_Word::$$_word  
Propertyprotectedinteger $_wordlen = 8
inherited

Length of the word to generate

Inherited from: \Zend_Captcha_Word::$$_wordlen
Default value8Details
Type
integer
Inherited_from
\Zend_Captcha_Word::$$_wordlen  

Methods

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

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()\Zend_Captcha_Base::__get()\Zend_Captcha_Word::__get()
Parameters
Name Type Description
$property string
Returns
Type Description
mixed
Throws
Exception Description
\Zend_Validate_Exception
methodprotected_createMessage(string $messageKey, string $value) : string
inherited

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

Inherited from: \Zend_Validate_Abstract::_createMessage()\Zend_Captcha_Base::_createMessage()\Zend_Captcha_Word::_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_gc() : void

Remove old files from image directory

methodprotected_generateImage(string $id, string $word) : void

Generate image captcha

Override this function if you want different image generator Wave transform from http://www.captcha.ru/captchas/multiwave/

Parameters
Name Type Description
$id string

Captcha ID

$word string

Captcha word

methodprotected_generateRandomId() : void
inherited

Inherited from: \Zend_Captcha_Word::_generateRandomId()
methodprotected_generateWord() : string
inherited

Generate new random word

Inherited from: \Zend_Captcha_Word::_generateWord()
Returns
Type Description
string
methodprotected_randomFreq() : float

Generate random frequency

Returns
Type Description
float
methodprotected_randomPhase() : float

Generate random phase

Returns
Type Description
float
methodprotected_randomSize() : int

Generate random character size

Returns
Type Description
int
methodprotected_setId(string $id) : void
inherited

Set captcha identifier

Inherited from: \Zend_Captcha_Word::_setId()
Parameters
Name Type Description
$id string

return Zend_Captcha_Word

methodprotected_setValue(mixed $value) : void
inherited

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

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

Set captcha word

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

Generate captcha

Returns
Type Description
string captcha ID
methodpublicgetDecorator() : string
inherited

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
staticinherited

Get default translation object for all validate objects

Inherited from: \Zend_Validate_Abstract::getDefaultTranslator()\Zend_Captcha_Base::getDefaultTranslator()\Zend_Captcha_Word::getDefaultTranslator()
Returns
Type Description
\Zend_Translate_Adapter | null
methodpublicgetDotNoiseLevel() : int

Returns
Type Description
int
methodpublicgetErrors() : array
inherited

Returns array of validation failure message codes

Inherited from: \Zend_Validate_Abstract::getErrors()\Zend_Captcha_Base::getErrors()\Zend_Captcha_Word::getErrors()
Returns
Type Description
array
methodpublicgetExpiration() : int

Get captcha expiration

Returns
Type Description
int
methodpublicgetFont() : string

Get font to use when generating captcha

Returns
Type Description
string
methodpublicgetFontSize() : int

Get font size

Returns
Type Description
int
methodpublicgetGcFreq() : int

Get garbage collection frequency

Returns
Type Description
int
methodpublicgetHeight() : int

Get captcha image height

Returns
Type Description
int
methodpublicgetId() : string
inherited

Retrieve captcha ID

Inherited from: \Zend_Captcha_Word::getId()
Returns
Type Description
string
methodpublicgetImgAlt() : string

Returns
Type Description
string
methodpublicgetImgDir() : string

Get captcha image directory

Returns
Type Description
string
methodpublicgetImgUrl() : string

Get captcha image base URL

Returns
Type Description
string
methodpublicgetLineNoiseLevel() : int

Returns
Type Description
int
methodpublicgetMessageLength() : integer
Returns
Type Description
integer
methodpublicgetMessageTemplates() : array
Returns
Type Description
array
methodpublicgetMessageVariables() : array
inherited

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

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

Returns array of validation failure messages

Inherited from: \Zend_Validate_Abstract::getMessages()\Zend_Captcha_Base::getMessages()\Zend_Captcha_Word::getMessages()

The array keys are validation failure message identifiers, and the array values are the corresponding human-readable message strings.

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
Returns
Type Description
string
methodpublicgetObscureValue() : bool
inherited

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

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

Retrieve options representing object state

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

Get session object

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

Retrieve session class to utilize

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

Returns
Type Description
string
methodpublicgetSuffix() : string

Get captcha image file suffix

Returns
Type Description
string
methodpublicgetTimeout() : int
inherited

Get session token timeout

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

Numbers should be included in the pattern?

Inherited from: \Zend_Captcha_Word::getUseNumbers()
Returns
Type Description
bool
methodpublicgetWidth() : int

Get captcha image width

Returns
Type Description
int
methodpublicgetWord() : string
inherited

Get captcha word

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

Retrieve word length to use when genrating captcha

Inherited from: \Zend_Captcha_Word::getWordlen()
Returns
Type Description
integer
methodpublichasDefaultTranslator() : boolean
Returns
Type Description
boolean
methodpublichasTranslator() : bool
inherited

Does this validator have its own specific translator?

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

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
\global\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
inherited

Set object state from config object

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

Set default translation object for all validate objects

Inherited from: \Zend_Validate_Abstract::setDefaultTranslator()\Zend_Captcha_Base::setDefaultTranslator()\Zend_Captcha_Word::setDefaultTranslator()
Parameters
Name Type Description
$translator \Zend_Translate | \Zend_Translate_Adapter | null
methodpublicsetDisableTranslator(bool $flag) : \Zend_Validate_Abstract
Parameters
Name Type Description
$flag bool
Returns
Type Description
\Zend_Validate_Abstract
methodpublicsetDotNoiseLevel(int $dotNoiseLevel) : void

Parameters
Name Type Description
$dotNoiseLevel int
methodpublicsetExpiration(int $expiration) : \Zend_Captcha_Image

Set captcha expiration

Parameters
Name Type Description
$expiration int
Returns
Type Description
\Zend_Captcha_Image
methodpublicsetFont(string $font) : \Zend_Captcha_Image

Set captcha font

Parameters
Name Type Description
$font string
Returns
Type Description
\Zend_Captcha_Image
methodpublicsetFontSize(int $fsize) : \Zend_Captcha_Image

Set captcha font size

Parameters
Name Type Description
$fsize int
Returns
Type Description
\Zend_Captcha_Image
methodpublicsetGcFreq(int $gcFreq) : \Zend_Captcha_Image

Set garbage collection frequency

Parameters
Name Type Description
$gcFreq int
Returns
Type Description
\Zend_Captcha_Image
methodpublicsetHeight(int $height) : \Zend_Captcha_Image

Set captcha image height

Parameters
Name Type Description
$height int
Returns
Type Description
\Zend_Captcha_Image
methodpublicsetImgAlt(string $imgAlt) : void

Parameters
Name Type Description
$imgAlt string
methodpublicsetImgDir(string $imgDir) : \Zend_Captcha_Image

Set captcha image storage directory

Parameters
Name Type Description
$imgDir string
Returns
Type Description
\Zend_Captcha_Image
methodpublicsetImgUrl(string $imgUrl) : \Zend_Captcha_Image

Set captcha image base URL

Parameters
Name Type Description
$imgUrl string
Returns
Type Description
\Zend_Captcha_Image
methodpublicsetKeepSession(bool $keepSession) : \Zend_Captcha_Word
inherited

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
methodpublicsetLineNoiseLevel(int $lineNoiseLevel) : void

Parameters
Name Type Description
$lineNoiseLevel int
methodpublicsetMessage(string $messageString, string $messageKey = null) : \Zend_Validate_Abstract
inherited

Sets the validation failure message template for a particular key

Inherited from: \Zend_Validate_Abstract::setMessage()\Zend_Captcha_Base::setMessage()\Zend_Captcha_Word::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 = -1) : void
Parameters
Name Type Description
$length integer
methodpublicsetMessages(array $messages) : \Zend_Validate_Abstract
inherited

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()\Zend_Captcha_Base::setMessages()\Zend_Captcha_Word::setMessages()
Parameters
Name Type Description
$messages array
Returns
Type Description
\Zend_Validate_Abstract
methodpublicsetName(string $name) : \Zend_Captcha_Adapter
Parameters
Name Type Description
$name string
Returns
Type Description
\Zend_Captcha_Adapter
methodpublicsetObscureValue(bool $flag) : \Zend_Validate_Abstract
inherited

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

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

Set single option for the object

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

Set object state from options array

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

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
inherited

Set session class for persistence

Inherited from: \Zend_Captcha_Word::setSessionClass()
Parameters
Name Type Description
$_sessionClass string
Returns
Type Description
\Zend_Captcha_Word
methodpublicsetStartImage(string $startImage) : void

Parameters
Name Type Description
$startImage string
methodpublicsetSuffix(string $suffix) : \Zend_Captcha_Image

Set captch image filename suffix

Parameters
Name Type Description
$suffix string
Returns
Type Description
\Zend_Captcha_Image
methodpublicsetTimeout(int $ttl) : \Zend_Captcha_Word
inherited

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
Parameters
Name Type Description
$translator \Zend_Translate | \Zend_Translate_Adapter | null
Returns
Type Description
\Zend_Validate_Abstract
methodpublicsetUseNumbers(bool $_useNumbers) : \Zend_Captcha_Word
inherited

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
methodpublicsetWidth(int $width) : \Zend_Captcha_Image

Set captcha image width

Parameters
Name Type Description
$width int
Returns
Type Description
\Zend_Captcha_Image
methodpublicsetWordlen(integer $wordlen) : \Zend_Captcha_Word
inherited

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
Returns
Type Description
bool
Documentation was generated by phpDocumentor 2.0.0a8.