API Documentation

Zend/Captcha/Word.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 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  

\Zend_Captcha_Word

Package: Zend\Captcha\Adapter

Word-based captcha adapter

Generates random word which user should recognise

Parent(s)
\Zend_Captcha_Base < \Zend_Validate_Abstract
Children
\Zend_Captcha_Figlet
\Zend_Captcha_Image
\Zend_Captcha_Dumb
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Version
$Id: Word.php 24594 2012-01-05 21:27:01Z matthew $  

Constants

Constant  MISSING_VALUE = 'missingValue'
Constant  MISSING_ID = 'missingID'
Constant  BAD_CAPTCHA = 'badCaptcha'

Properties

Propertypublic  $C= 'array("b"'
static
Default valuearray("b"Details
Type
Propertypublic  $CN= 'array("b"'
static
Default valuearray("b"Details
Type
Propertypublic  $V= 'array("a"'
static
Default valuearray("a"Details
Type
Propertypublic  $VN= 'array("a"'
static
Default valuearray("a"Details
Type
Propertyprotectedstring  $_id= ''

Random session ID

Details
Type
string
Propertyprotectedboolean  $_keepSession= 'false'

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

Default valuefalseDetails
Type
boolean
Propertyprotectedarray  $_messageTemplates= 'array( self::MISSING_VALUE => 'Empty captcha value''

Error messages

Default valuearray( self::MISSING_VALUE => 'Empty captcha value'Details
Type
array
Propertyprotected\Zend_Session_Namespace  $_session= ''

Session

Propertyprotectedstring  $_sessionClass= ''Zend_Session_Namespace''

Class name for sessions

Default value'Zend_Session_Namespace'Details
Type
string
Propertyprotectedinteger  $_timeout= '300'

Session lifetime for the captcha data

Default value300Details
Type
integer
Propertyprotectedboolean  $_useNumbers= 'true'

Should the numbers be used or only letters

Default valuetrueDetails
Type
boolean
Propertyprotectedstring  $_word= ''

Generated word

Details
Type
string
Propertyprotectedinteger  $_wordlen= '8'

Length of the word to generate

Default value8Details
Type
integer

Methods

methodprotected_generateRandomId( ) : void

methodprotected_generateWord( ) : string

Generate new random word

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

Set captcha identifier

Parameters
Name Type Description
$id string

return Zend_Captcha_Word

methodprotected_setWord( string $word ) : \Zend_Captcha_Word

Set captcha word

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

Generate new session ID and new word

Returns
Type Description
string session ID
methodpublicgetDecorator( ) : string

Get captcha decorator

Returns
Type Description
string
methodpublicgetId( ) : string

Retrieve captcha ID

Returns
Type Description
string
methodpublicgetSession( ) : \Zend_Session_Namespace

Get session object

Returns
Type Description
\Zend_Session_Namespace
methodpublicgetSessionClass( ) : string

Retrieve session class to utilize

Returns
Type Description
string
methodpublicgetTimeout( ) : int

Get session token timeout

Returns
Type Description
int
methodpublicgetUseNumbers( ) : bool

Numbers should be included in the pattern?

Returns
Type Description
bool
methodpublicgetWord( ) : string

Get captcha word

Returns
Type Description
string
methodpublicgetWordlen( ) : integer

Retrieve word length to use when genrating captcha

Returns
Type Description
integer
methodpublicisValid( mixed $value,  $context = null ) : boolean

Validate the word

Parameters
Name Type Description
$value mixed
$context
Returns
Type Description
boolean
Details
See
\Zend_Validate_Interface::isValid()  
methodpublicsetKeepSession( bool $keepSession ) : \Zend_Captcha_Word

Sets if session should be preserved on generate()

Parameters
Name Type Description
$keepSession bool

Should session be kept on generate()?

Returns
Type Description
\Zend_Captcha_Word
methodpublicsetSession( \Zend_Session_Namespace $session ) : \Zend_Captcha_Word

Set session namespace object

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

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

Set timeout for session token

Parameters
Name Type Description
$ttl int
Returns
Type Description
\Zend_Captcha_Word
methodpublicsetUseNumbers( bool $_useNumbers ) : \Zend_Captcha_Word

Set if numbers should be included in the pattern

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

Parameters
Name Type Description
$wordlen integer
Returns
Type Description
\Zend_Captcha_Word
Documentation was generated by DocBlox 0.15.1.