PHP Класс SlightPHP\SimpleCaptcha

Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$Xamplitude
$Xperiod
$Yamplitude
$Yperiod Wave configuracion in X and Y axes
$backgroundColor Background color in RGB-array
$blur Better image results with scale=3
$colors Foreground colors in RGB-array
$debug Debug?
$fonts - font: TTF file - spacing: relative pixel space between character - minSize: min font size - maxSize: max font size
$height Height of the image
$im GD image
$imageFormat Image format: jpeg or png
$maxRotation letter rotation clockwise
$maxWordLength Used for dictionary words indicating the word-length for font-size modification purposes
$minWordLength Min word length (for non-dictionary random text generation)
$scale Internal image size factor (for better image quality) 1: low, 2: medium, 3: high
$session_var Sessionname to store the original text
$shadowColor Shadow color in RGB-array or false
$transprent
$width Width of the image
$wordsFile Dictionary word file (empty for randnom text)

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

Метод Описание
CreateImage ( )
GetDictionaryCaptchaText ( boolean $extended = false ) : string Random dictionary word generation
__construct ( $config = [] )

Защищенные методы

Метод Описание
Cleanup ( ) Cleanup
GetCaptchaText ( ) : string Text generation
GetRandomCaptchaText ( $length = null ) : string Random text generation
ImageAllocate ( ) Creates the image resources
ReduceImage ( ) Reduce the image to the final size
WaveImage ( ) Wave filter
WriteImage ( ) File generation
WriteText ( $text, $fontcfg = [] ) Text insertion

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

Cleanup() защищенный Метод

Cleanup
protected Cleanup ( )

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

public CreateImage ( )

GetCaptchaText() защищенный Метод

Text generation
protected GetCaptchaText ( ) : string
Результат string Text

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

Random dictionary word generation
public GetDictionaryCaptchaText ( boolean $extended = false ) : string
$extended boolean Add extended "fake" words
Результат string Word

GetRandomCaptchaText() защищенный Метод

Random text generation
protected GetRandomCaptchaText ( $length = null ) : string
Результат string Text

ImageAllocate() защищенный Метод

Creates the image resources
protected ImageAllocate ( )

ReduceImage() защищенный Метод

Reduce the image to the final size
protected ReduceImage ( )

WaveImage() защищенный Метод

Wave filter
protected WaveImage ( )

WriteImage() защищенный Метод

File generation
protected WriteImage ( )

WriteText() защищенный Метод

Text insertion
protected WriteText ( $text, $fontcfg = [] )

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

public __construct ( $config = [] )

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

$Xamplitude публичное свойство

public $Xamplitude

$Xperiod публичное свойство

public $Xperiod

$Yamplitude публичное свойство

public $Yamplitude

$Yperiod публичное свойство

Wave configuracion in X and Y axes
public $Yperiod

$backgroundColor публичное свойство

Background color in RGB-array
public $backgroundColor

$blur публичное свойство

Better image results with scale=3
public $blur

$colors публичное свойство

Foreground colors in RGB-array
public $colors

$debug публичное свойство

Debug?
public $debug

$fonts публичное свойство

- font: TTF file - spacing: relative pixel space between character - minSize: min font size - maxSize: max font size
public $fonts

$height публичное свойство

Height of the image
public $height

$im публичное свойство

GD image
public $im

$imageFormat публичное свойство

Image format: jpeg or png
public $imageFormat

$maxRotation публичное свойство

letter rotation clockwise
public $maxRotation

$maxWordLength публичное свойство

Used for dictionary words indicating the word-length for font-size modification purposes
public $maxWordLength

$minWordLength публичное свойство

Min word length (for non-dictionary random text generation)
public $minWordLength

$scale публичное свойство

Internal image size factor (for better image quality) 1: low, 2: medium, 3: high
public $scale

$session_var публичное свойство

Sessionname to store the original text
public $session_var

$shadowColor публичное свойство

Shadow color in RGB-array or false
public $shadowColor

$transprent публичное свойство

public $transprent

$width публичное свойство

Width of the image
public $width

$wordsFile публичное свойство

Dictionary word file (empty for randnom text)
public $wordsFile