API Documentation

Zend/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 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 24594 2012-01-05 21:27:01Z matthew $  

\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  

Properties

Propertyprotectedint  $_dotNoiseLevel= '100'

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

Default value100Details
Type
int
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  $_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
Propertyprotectedint  $_lineNoiseLevel= '5'

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

Default value5Details
Type
int
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
Propertyprotectedint  $_width= '200'

Image width

Default value200Details
Type
int

Methods

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_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
methodpublicgenerate( ) : string

Generate captcha

Returns
Type Description
string captcha ID
methodpublicgetDotNoiseLevel( ) : int

Returns
Type Description
int
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
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
methodpublicgetStartImage( ) : string

Returns
Type Description
string
methodpublicgetSuffix( ) : string

Get captcha image file suffix

Returns
Type Description
string
methodpublicgetWidth( ) : int

Get captcha image width

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

Parameters
Name Type Description
$lineNoiseLevel int
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
methodpublicsetWidth( int $width ) : \Zend_Captcha_Image

Set captcha image width

Parameters
Name Type Description
$width int
Returns
Type Description
\Zend_Captcha_Image
Documentation was generated by DocBlox 0.15.1.