PHP Class SlightPHP\SimpleCaptcha

显示文件 Open project: hetao29/slightphp

Public Properties

Property Type Description
$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)

Public Methods

Method Description
CreateImage ( )
GetDictionaryCaptchaText ( boolean $extended = false ) : string Random dictionary word generation
__construct ( $config = [] )

Protected Methods

Method Description
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

Method Details

Cleanup() protected method

Cleanup
protected Cleanup ( )

CreateImage() public method

public CreateImage ( )

GetCaptchaText() protected method

Text generation
protected GetCaptchaText ( ) : string
return string Text

GetDictionaryCaptchaText() public method

Random dictionary word generation
public GetDictionaryCaptchaText ( boolean $extended = false ) : string
$extended boolean Add extended "fake" words
return string Word

GetRandomCaptchaText() protected method

Random text generation
protected GetRandomCaptchaText ( $length = null ) : string
return string Text

ImageAllocate() protected method

Creates the image resources
protected ImageAllocate ( )

ReduceImage() protected method

Reduce the image to the final size
protected ReduceImage ( )

WaveImage() protected method

Wave filter
protected WaveImage ( )

WriteImage() protected method

File generation
protected WriteImage ( )

WriteText() protected method

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

__construct() public method

public __construct ( $config = [] )

Property Details

$Xamplitude public_oe property

public $Xamplitude

$Xperiod public_oe property

public $Xperiod

$Yamplitude public_oe property

public $Yamplitude

$Yperiod public_oe property

Wave configuracion in X and Y axes
public $Yperiod

$backgroundColor public_oe property

Background color in RGB-array
public $backgroundColor

$blur public_oe property

Better image results with scale=3
public $blur

$colors public_oe property

Foreground colors in RGB-array
public $colors

$debug public_oe property

Debug?
public $debug

$fonts public_oe property

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

$height public_oe property

Height of the image
public $height

$im public_oe property

GD image
public $im

$imageFormat public_oe property

Image format: jpeg or png
public $imageFormat

$maxRotation public_oe property

letter rotation clockwise
public $maxRotation

$maxWordLength public_oe property

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

$minWordLength public_oe property

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

$scale public_oe property

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

$session_var public_oe property

Sessionname to store the original text
public $session_var

$shadowColor public_oe property

Shadow color in RGB-array or false
public $shadowColor

$transprent public_oe property

public $transprent

$width public_oe property

Width of the image
public $width

$wordsFile public_oe property

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