Captcha/Image.php

Show: PublicProtectedPrivateinherited
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 license@zend.com 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

>VConstant  MISSING_VALUE = 'missingValue'
inheritedInherited from: \Zend_Captcha_Word::MISSING_VALUE
>VConstant  MISSING_ID = 'missingID'
inheritedInherited from: \Zend_Captcha_Word::MISSING_ID
>VConstant  BAD_CAPTCHA = 'badCaptcha'
inheritedInherited from: \Zend_Captcha_Word::BAD_CAPTCHA

Properties

>VPropertypublic$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  
>VPropertypublic$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  
>VPropertypublic$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  
>VPropertypublic$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  
>VPropertyprotected\Zend_Translate $_defaultTranslator
>VPropertyprotectedint $_dotNoiseLevel = 100
Number of noise dots on image Used twice - before and after transform
Default value100Details
Type
int
>VPropertyprotectedarray $_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  
>VPropertyprotectedint $_expiration = 600
How long to keep generated images
Default value600Details
Type
int
>VPropertyprotectedstring $_font
Image font file
Details
Type
string
>VPropertyprotectedint $_fsize = 24
Font size
Default value24Details
Type
int
>VPropertyprotectedint $_gcFreq = 10
How frequently to execute garbage collection
Default value10Details
Type
int
>VPropertyprotectedint $_height = 50
Image height
Default value50Details
Type
int
>VPropertyprotectedstring $_id
inherited
Random session ID
Inherited from: \Zend_Captcha_Word::$$_id
Details
Type
string
Inherited_from
\Zend_Captcha_Word::$$_id  
>VPropertyprotectedstring $_imgAlt = ""
Image's alt tag content
Default value""Details
Type
string
>VPropertyprotectedstring $_imgDir = "./images/captcha/"
Directory for generated images
Default value"./images/captcha/"Details
Type
string
>VPropertyprotectedstring $_imgUrl = "/images/captcha/"
URL for accessing images
Default value"/images/captcha/"Details
Type
string
>VPropertyprotectedboolean $_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  
>VPropertyprotectedint $_lineNoiseLevel = 5
Number of noise lines on image Used twice - before and after transform
Default value5Details
Type
int
>VPropertyprotectedInteger $_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  
>VPropertyprotectedarray $_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  
>VPropertyprotectedarray $_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  
>VPropertyprotectedarray $_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  
>VPropertyprotectedstring $_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  
>VPropertyprotectedbool $_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  
>VPropertyprotectedarray $_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  
>VPropertyprotected\Zend_Session_Namespace $_session
inherited
Session
Inherited from: \Zend_Captcha_Word::$$_session
>VPropertyprotectedstring $_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  
>VPropertyprotectedarray $_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  
>VPropertyprotectedstring $_startImage
Image to use as starting point Default is blank image.

If provided, should be PNG image.

Details
Type
string
>VPropertyprotectedstring $_suffix = ".png"
Image suffix (including dot)
Default value".png"Details
Type
string
>VPropertyprotectedinteger $_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  
>VPropertyprotectedBoolean $_translatorDisabled = false
Default valuefalseDetails
Type
Boolean
Inherited_from
\Zend_Validate_Abstract::$$_translatorDisabled  
Inherited_from
\Zend_Captcha_Base::$$_translatorDisabled  
Inherited_from
\Zend_Captcha_Word::$$_translatorDisabled  
>VPropertyprotectedboolean $_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  
>VPropertyprotectedmixed $_value
Details
Type
mixed
Inherited_from
\Zend_Validate_Abstract::$$_value  
Inherited_from
\Zend_Captcha_Base::$$_value  
Inherited_from
\Zend_Captcha_Word::$$_value  
>VPropertyprotectedint $_width = 200
Image width
Default value200Details
Type
int
>VPropertyprotectedstring $_word
inherited
Generated word
Inherited from: \Zend_Captcha_Word::$$_word
Details
Type
string
Inherited_from
\Zend_Captcha_Word::$$_word  
>VPropertyprotectedinteger $_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
NameTypeDescription
$optionsarray | \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
NameTypeDescription
$propertystring
Returns
TypeDescription
mixed
Throws
ExceptionDescription
\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
NameTypeDescription
$messageKeystring
$valuestring
Returns
TypeDescription
string
methodprotected_error(string $messageKey, string $value = null) : void
Parameters
NameTypeDescription
$messageKeystring
$valuestring

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
NameTypeDescription
$idstring

Captcha ID

$wordstring

Captcha word

methodprotected_generateRandomId() : void
methodprotected_generateWord() : string
inherited

Generate new random word

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

Generate random frequency

Returns
TypeDescription
float
methodprotected_randomPhase() : float

Generate random phase

Returns
TypeDescription
float
methodprotected_randomSize() : int

Generate random character size

Returns
TypeDescription
int
methodprotected_setId(string $id) : void
inherited

Set captcha identifier

Inherited from: \Zend_Captcha_Word::_setId()
Parameters
NameTypeDescription
$idstring

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
NameTypeDescription
$valuemixed
methodprotected_setWord(string $word) : \Zend_Captcha_Word
inherited

Set captcha word

Inherited from: \Zend_Captcha_Word::_setWord()
Parameters
NameTypeDescription
$wordstring
Returns
TypeDescription
\Zend_Captcha_Word
methodpublicgenerate() : string

Generate captcha

Returns
TypeDescription
stringcaptcha ID
methodpublicgetDecorator() : string
inherited

Get captcha decorator

Inherited from: \Zend_Captcha_Word::getDecorator()

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

Returns
TypeDescription
string
methodpublicgetDefaultTranslator() : \Zend_Translate_Adapter | null
Returns
TypeDescription
\Zend_Translate_Adapter | null
methodpublicgetDotNoiseLevel() : int

Returns
TypeDescription
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
TypeDescription
array
methodpublicgetExpiration() : int

Get captcha expiration

Returns
TypeDescription
int
methodpublicgetFont() : string

Get font to use when generating captcha

Returns
TypeDescription
string
methodpublicgetFontSize() : int

Get font size

Returns
TypeDescription
int
methodpublicgetGcFreq() : int

Get garbage collection frequency

Returns
TypeDescription
int
methodpublicgetHeight() : int

Get captcha image height

Returns
TypeDescription
int
methodpublicgetId() : string
inherited

Retrieve captcha ID

Inherited from: \Zend_Captcha_Word::getId()
Returns
TypeDescription
string
methodpublicgetImgAlt() : string

Returns
TypeDescription
string
methodpublicgetImgDir() : string

Get captcha image directory

Returns
TypeDescription
string
methodpublicgetImgUrl() : string

Get captcha image base URL

Returns
TypeDescription
string
methodpublicgetLineNoiseLevel() : int

Returns
TypeDescription
int
methodpublicgetMessageLength() : integer
Returns
TypeDescription
integer
methodpublicgetMessageTemplates() : array
Returns
TypeDescription
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
TypeDescription
array
methodpublicgetMessages() : array
inherited

Returns an array of messages that explain why the most recent isValid() call returned false.

Inherited from: \Zend_Validate_Interface::getMessages()\Zend_Captcha_Adapter::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
TypeDescription
array
methodpublicgetName() : string
Returns
TypeDescription
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
TypeDescription
bool
methodpublicgetOptions() : array
inherited

Retrieve options representing object state

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

Get session object

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

Retrieve session class to utilize

Inherited from: \Zend_Captcha_Word::getSessionClass()
Returns
TypeDescription
string
methodpublicgetStartImage() : string

Returns
TypeDescription
string
methodpublicgetSuffix() : string

Get captcha image file suffix

Returns
TypeDescription
string
methodpublicgetTimeout() : int
inherited

Get session token timeout

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

Numbers should be included in the pattern?

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

Get captcha image width

Returns
TypeDescription
int
methodpublicgetWord() : string
inherited

Get captcha word

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

Retrieve word length to use when genrating captcha

Inherited from: \Zend_Captcha_Word::getWordlen()
Returns
TypeDescription
integer
methodpublichasDefaultTranslator() : boolean
Returns
TypeDescription
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
TypeDescription
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
NameTypeDescription
$valuemixed
$context
Returns
TypeDescription
boolean
Throws
ExceptionDescription
\Zend_Validate_ExceptionIf 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
NameTypeDescription
$view\Zend_View_Interface
$elementmixed
Returns
TypeDescription
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
NameTypeDescription
$config\Zend_Config
Returns
TypeDescription
\Zend_Captcha_Base
methodpublicsetDefaultTranslator(\Zend_Translate | \Zend_Translate_Adapter | null $translator = null) : void
Parameters
NameTypeDescription
$translator\Zend_Translate | \Zend_Translate_Adapter | null
methodpublicsetDisableTranslator(bool $flag) : \Zend_Validate_Abstract
Parameters
NameTypeDescription
$flagbool
Returns
TypeDescription
\Zend_Validate_Abstract
methodpublicsetDotNoiseLevel(int $dotNoiseLevel) : void

Parameters
NameTypeDescription
$dotNoiseLevelint
methodpublicsetExpiration(int $expiration) : \Zend_Captcha_Image

Set captcha expiration

Parameters
NameTypeDescription
$expirationint
Returns
TypeDescription
\Zend_Captcha_Image
methodpublicsetFont(string $font) : \Zend_Captcha_Image

Set captcha font

Parameters
NameTypeDescription
$fontstring
Returns
TypeDescription
\Zend_Captcha_Image
methodpublicsetFontSize(int $fsize) : \Zend_Captcha_Image

Set captcha font size

Parameters
NameTypeDescription
$fsizeint
Returns
TypeDescription
\Zend_Captcha_Image
methodpublicsetGcFreq(int $gcFreq) : \Zend_Captcha_Image

Set garbage collection frequency

Parameters
NameTypeDescription
$gcFreqint
Returns
TypeDescription
\Zend_Captcha_Image
methodpublicsetHeight(int $height) : \Zend_Captcha_Image

Set captcha image height

Parameters
NameTypeDescription
$heightint
Returns
TypeDescription
\Zend_Captcha_Image
methodpublicsetImgAlt(string $imgAlt) : void

Parameters
NameTypeDescription
$imgAltstring
methodpublicsetImgDir(string $imgDir) : \Zend_Captcha_Image

Set captcha image storage directory

Parameters
NameTypeDescription
$imgDirstring
Returns
TypeDescription
\Zend_Captcha_Image
methodpublicsetImgUrl(string $imgUrl) : \Zend_Captcha_Image

Set captcha image base URL

Parameters
NameTypeDescription
$imgUrlstring
Returns
TypeDescription
\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
NameTypeDescription
$keepSessionbool

Should session be kept on generate()?

Returns
TypeDescription
\Zend_Captcha_Word
methodpublicsetLineNoiseLevel(int $lineNoiseLevel) : void

Parameters
NameTypeDescription
$lineNoiseLevelint
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
NameTypeDescription
$messageStringstring
$messageKeystring

OPTIONAL

Returns
TypeDescription
\Zend_Validate_AbstractProvides a fluent interface
Throws
ExceptionDescription
\Zend_Validate_Exception
methodpublicsetMessageLength(integer $length = -1) : void
Parameters
NameTypeDescription
$lengthinteger
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
NameTypeDescription
$messagesarray
Returns
TypeDescription
\Zend_Validate_Abstract
methodpublicsetName(string $name) : \Zend_Captcha_Adapter
Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
\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
NameTypeDescription
$flagbool
Returns
TypeDescription
\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
NameTypeDescription
$keystring
$valuestring
Returns
TypeDescription
\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
NameTypeDescription
$optionsarray
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetSession(\Zend_Session_Namespace $session) : \Zend_Captcha_Word
inherited

Set session namespace object

Inherited from: \Zend_Captcha_Word::setSession()
Parameters
NameTypeDescription
$session\Zend_Session_Namespace
Returns
TypeDescription
\Zend_Captcha_Word
methodpublicsetSessionClass(string $_sessionClass) : \Zend_Captcha_Word
inherited

Set session class for persistence

Inherited from: \Zend_Captcha_Word::setSessionClass()
Parameters
NameTypeDescription
$_sessionClassstring
Returns
TypeDescription
\Zend_Captcha_Word
methodpublicsetStartImage(string $startImage) : void

Parameters
NameTypeDescription
$startImagestring
methodpublicsetSuffix(string $suffix) : \Zend_Captcha_Image

Set captch image filename suffix

Parameters
NameTypeDescription
$suffixstring
Returns
TypeDescription
\Zend_Captcha_Image
methodpublicsetTimeout(int $ttl) : \Zend_Captcha_Word
inherited

Set timeout for session token

Inherited from: \Zend_Captcha_Word::setTimeout()
Parameters
NameTypeDescription
$ttlint
Returns
TypeDescription
\Zend_Captcha_Word
methodpublicsetTranslator(\Zend_Translate | \Zend_Translate_Adapter | null $translator = null) : \Zend_Validate_Abstract
Parameters
NameTypeDescription
$translator\Zend_Translate | \Zend_Translate_Adapter | null
Returns
TypeDescription
\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
NameTypeDescription
$_useNumbersbool

numbers should be included in the pattern?

Returns
TypeDescription
\Zend_Captcha_Word
methodpublicsetWidth(int $width) : \Zend_Captcha_Image

Set captcha image width

Parameters
NameTypeDescription
$widthint
Returns
TypeDescription
\Zend_Captcha_Image
methodpublicsetWordlen(integer $wordlen) : \Zend_Captcha_Word
inherited

Set word length of captcha

Inherited from: \Zend_Captcha_Word::setWordlen()
Parameters
NameTypeDescription
$wordleninteger
Returns
TypeDescription
\Zend_Captcha_Word
methodpublictranslatorIsDisabled() : bool
Returns
TypeDescription
bool
Documentation was generated by phpDocumentor 2.0.0a12.