Captcha/Image.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-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Captcha
- Subpackage
- Adapter
- Version
- $Id$
\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-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties

int $_dotNoiseLevel = 100Number of noise dots on image
Used twice - before and after transform
Default value
100Details- Type
- int

string $_imgDir = "./images/captcha/"Directory for generated images
Default value
"./images/captcha/"Details- Type
- string

string $_imgUrl = "/images/captcha/"URL for accessing images
Default value
"/images/captcha/"Details- Type
- string

int $_lineNoiseLevel = 5Number of noise lines on image
Used twice - before and after transform
Default value
5Details- Type
- int

string $_startImageImage to use as starting point
Default is blank image. If provided, should be PNG image.
Details
- Type
- string
Methods

_generateImage(string $id, string $word) : voidGenerate 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 |

render(\Zend_View_Interface $view = null, mixed $element = null) : stringDisplay the captcha
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $view | \Zend_View_Interface | |
| $element | mixed |
| Type | Description |
|---|---|
| string |

setExpiration(int $expiration) : \Zend_Captcha_ImageSet captcha expiration
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $expiration | int |
| Type | Description |
|---|---|
| \Zend_Captcha_Image |

setFont(string $font) : \Zend_Captcha_ImageSet captcha font
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $font | string |
| Type | Description |
|---|---|
| \Zend_Captcha_Image |

setFontSize(int $fsize) : \Zend_Captcha_ImageSet captcha font size
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $fsize | int |
| Type | Description |
|---|---|
| \Zend_Captcha_Image |

setGcFreq(int $gcFreq) : \Zend_Captcha_ImageSet garbage collection frequency
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $gcFreq | int |
| Type | Description |
|---|---|
| \Zend_Captcha_Image |

setHeight(int $height) : \Zend_Captcha_ImageSet captcha image height
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $height | int |
| Type | Description |
|---|---|
| \Zend_Captcha_Image |

setImgDir(string $imgDir) : \Zend_Captcha_ImageSet captcha image storage directory
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $imgDir | string |
| Type | Description |
|---|---|
| \Zend_Captcha_Image |

setImgUrl(string $imgUrl) : \Zend_Captcha_ImageSet captcha image base URL
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $imgUrl | string |
| Type | Description |
|---|---|
| \Zend_Captcha_Image |

setSuffix(string $suffix) : \Zend_Captcha_ImageSet captch image filename suffix
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $suffix | string |
| Type | Description |
|---|---|
| \Zend_Captcha_Image |

setWidth(int $width) : \Zend_Captcha_ImageSet captcha image width
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $width | int |
| Type | Description |
|---|---|
| \Zend_Captcha_Image |