PHP Класс Pop\Image\Captcha

Автор: Nick Sagona, III ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$border mixed CAPTCHA border width
$colors integer CAPTCHA colors
$expire integer CAPTCHA token expiration in seconds
$font string CAPTCHA font
$grid integer CAPTCHA grid spacing
$image mixed CAPTCHA image resource
$length integer CAPTCHA string length
$rotate integer CAPTCHA rotate
$size integer CAPTCHA font size (if using system fonts, it will be capped at 5)
$swirl integer CAPTCHA swirl
$token array CAPTCHA token object
$x integer CAPTCHA x
$y integer CAPTCHA y

Открытые методы

Метод Описание
__construct ( array $options, boolean $forceGd = false ) : Captcha Constructor
factory ( array $options, boolean $forceGd = false ) : Captcha Static method to instantiate the CAPTCHA image object and return itself to facilitate chaining methods together.
generateToken ( ) : void Method to generate the token object
getBackgroundColor ( ) : array Method to get the background color
getBorderColor ( ) : array Method to get the border color
getBorderWidth ( ) : mixed Method to get the border width
getExpire ( ) : integer Method to get the expiration length in seconds
getFont ( ) : string Method to get the font
getGridColor ( ) : array Method to get the grid color
getGridWidth ( ) : integer Method to get the grid spacing
getLength ( ) : integer Method to get the string length
getRotate ( ) : integer Method to get the rotation
getSize ( ) : integer Method to get the font size
getSwirl ( ) : integer Method to get the swirl
getTextColor ( ) : array Method to get the text color
getToken ( ) : array Method to get the token object, generating a new one if necessary
getX ( ) : integer Method to get the X position
getY ( ) : integer Method to get the Y position
image ( ) : mixed Method to get the image object
output ( ) : void Method to output the image object
setBackgroundColor ( integer $r, integer $g, integer $b ) : Captcha Method to set the background color
setBorderColor ( integer $r = null, integer $g = null, integer $b = null ) : Captcha Method to set the border color
setBorderWidth ( mixed $border = 0.55 ) : Captcha Method to set the border width
setExpire ( integer $expire = 300 ) : Captcha Method to set the expiration length in seconds
setFont ( string $font = null ) : Captcha Method to set the font
setGridColor ( integer $r = null, integer $g = null, integer $b = null ) : Captcha Method to set the grid color
setGridWidth ( integer $grid = 5 ) : Captcha Method to set the grid spacing
setLength ( integer $length = 4 ) : Captcha Method to set the string length
setRotate ( integer $rotate = null ) : Captcha Method to set the rotation
setSize ( integer $size = 20 ) : Captcha Method to set the font size
setSwirl ( integer $swirl = null ) : Captcha Method to set the swirl
setTextColor ( integer $r, integer $g, integer $b ) : Captcha Method to set the text color
setX ( integer $x = null ) : Captcha Method to set the X position
setXY ( integer $x = null, integer $y = null ) : Captcha Method to set the X, Y position
setY ( integer $y = null ) : Captcha Method to set the Y position

Описание методов

__construct() публичный Метод

Instantiate a CAPTCHA image object. Valid options are: $options = array( 'width' => 75, 'height' => 25, 'background' => array(200, 200, 200) // R, G, B values for the background color ); $options = array( 'image' => 'some-image-background,gif' ); This $forceGd flag forces the object to use the Gd extension. If both are installed, it will default to Imagick unless this flag is set to true.
public __construct ( array $options, boolean $forceGd = false ) : Captcha
$options array
$forceGd boolean
Результат Captcha

factory() публичный статический Метод

Static method to instantiate the CAPTCHA image object and return itself to facilitate chaining methods together.
public static factory ( array $options, boolean $forceGd = false ) : Captcha
$options array
$forceGd boolean
Результат Captcha

generateToken() публичный Метод

Method to generate the token object
public generateToken ( ) : void
Результат void

getBackgroundColor() публичный Метод

Method to get the background color
public getBackgroundColor ( ) : array
Результат array

getBorderColor() публичный Метод

Method to get the border color
public getBorderColor ( ) : array
Результат array

getBorderWidth() публичный Метод

Method to get the border width
public getBorderWidth ( ) : mixed
Результат mixed

getExpire() публичный Метод

Method to get the expiration length in seconds
public getExpire ( ) : integer
Результат integer

getFont() публичный Метод

Method to get the font
public getFont ( ) : string
Результат string

getGridColor() публичный Метод

Method to get the grid color
public getGridColor ( ) : array
Результат array

getGridWidth() публичный Метод

Method to get the grid spacing
public getGridWidth ( ) : integer
Результат integer

getLength() публичный Метод

Method to get the string length
public getLength ( ) : integer
Результат integer

getRotate() публичный Метод

Method to get the rotation
public getRotate ( ) : integer
Результат integer

getSize() публичный Метод

Method to get the font size
public getSize ( ) : integer
Результат integer

getSwirl() публичный Метод

Method to get the swirl
public getSwirl ( ) : integer
Результат integer

getTextColor() публичный Метод

Method to get the text color
public getTextColor ( ) : array
Результат array

getToken() публичный Метод

Method to get the token object, generating a new one if necessary
public getToken ( ) : array
Результат array

getX() публичный Метод

Method to get the X position
public getX ( ) : integer
Результат integer

getY() публичный Метод

Method to get the Y position
public getY ( ) : integer
Результат integer

image() публичный Метод

Method to get the image object
public image ( ) : mixed
Результат mixed

output() публичный Метод

Method to output the image object
public output ( ) : void
Результат void

setBackgroundColor() публичный Метод

Method to set the background color
public setBackgroundColor ( integer $r, integer $g, integer $b ) : Captcha
$r integer
$g integer
$b integer
Результат Captcha

setBorderColor() публичный Метод

Method to set the border color
public setBorderColor ( integer $r = null, integer $g = null, integer $b = null ) : Captcha
$r integer
$g integer
$b integer
Результат Captcha

setBorderWidth() публичный Метод

Method to set the border width
public setBorderWidth ( mixed $border = 0.55 ) : Captcha
$border mixed
Результат Captcha

setExpire() публичный Метод

Method to set the expiration length in seconds
public setExpire ( integer $expire = 300 ) : Captcha
$expire integer
Результат Captcha

setFont() публичный Метод

Method to set the font
public setFont ( string $font = null ) : Captcha
$font string
Результат Captcha

setGridColor() публичный Метод

Method to set the grid color
public setGridColor ( integer $r = null, integer $g = null, integer $b = null ) : Captcha
$r integer
$g integer
$b integer
Результат Captcha

setGridWidth() публичный Метод

Method to set the grid spacing
public setGridWidth ( integer $grid = 5 ) : Captcha
$grid integer
Результат Captcha

setLength() публичный Метод

Method to set the string length
public setLength ( integer $length = 4 ) : Captcha
$length integer
Результат Captcha

setRotate() публичный Метод

Method to set the rotation
public setRotate ( integer $rotate = null ) : Captcha
$rotate integer
Результат Captcha

setSize() публичный Метод

Method to set the font size
public setSize ( integer $size = 20 ) : Captcha
$size integer
Результат Captcha

setSwirl() публичный Метод

Method to set the swirl
public setSwirl ( integer $swirl = null ) : Captcha
$swirl integer
Результат Captcha

setTextColor() публичный Метод

Method to set the text color
public setTextColor ( integer $r, integer $g, integer $b ) : Captcha
$r integer
$g integer
$b integer
Результат Captcha

setX() публичный Метод

Method to set the X position
public setX ( integer $x = null ) : Captcha
$x integer
Результат Captcha

setXY() публичный Метод

Method to set the X, Y position
public setXY ( integer $x = null, integer $y = null ) : Captcha
$x integer
$y integer
Результат Captcha

setY() публичный Метод

Method to set the Y position
public setY ( integer $y = null ) : Captcha
$y integer
Результат Captcha

Описание свойств

$border защищенное свойство

CAPTCHA border width
protected mixed $border
Результат mixed

$colors защищенное свойство

CAPTCHA colors
protected int $colors
Результат integer

$expire защищенное свойство

CAPTCHA token expiration in seconds
protected int $expire
Результат integer

$font защищенное свойство

CAPTCHA font
protected string $font
Результат string

$grid защищенное свойство

CAPTCHA grid spacing
protected int $grid
Результат integer

$image защищенное свойство

CAPTCHA image resource
protected mixed $image
Результат mixed

$length защищенное свойство

CAPTCHA string length
protected int $length
Результат integer

$rotate защищенное свойство

CAPTCHA rotate
protected int $rotate
Результат integer

$size защищенное свойство

CAPTCHA font size (if using system fonts, it will be capped at 5)
protected int $size
Результат integer

$swirl защищенное свойство

CAPTCHA swirl
protected int $swirl
Результат integer

$token защищенное свойство

CAPTCHA token object
protected array $token
Результат array

$x защищенное свойство

CAPTCHA x
protected int $x
Результат integer

$y защищенное свойство

CAPTCHA y
protected int $y
Результат integer