Documentation

Captcha
in package

Image captcha class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
4.0.0

Table of Contents

Properties

$answer  : string|null
CAPTCHA answer length
$config  : array<string|int, mixed>
CAPTCHA image config
$expire  : int
CAPTCHA expiration
$image  : AbstractAdapter|null
CAPTCHA image
$length  : int
CAPTCHA length
$reload  : string
CAPTCHA reload text
$token  : array<string|int, mixed>
Current token data
$uppercase  : bool
CAPTCHA uppercase flag
$url  : string|null
CAPTCHA URL

Methods

__construct()  : mixed
Constructor
__toString()  : string
Print out the image
createImage()  : Captcha
Create CAPTCHA image
createNewToken()  : Captcha
Create CAPTCHA token
getAnswer()  : string|null
Get CAPTCHA answer
getConfig()  : array<string|int, mixed>
Get CAPTCHA image config
getExpire()  : int
Get CAPTCHA expiration
getImage()  : AbstractAdapter|null
Get CAPTCHA image
getImageHtml()  : string
Get CAPTCHA image HTML
getLength()  : int
Get CAPTCHA answer length
getReload()  : string
Get CAPTCHA reload text
getToken()  : array<string|int, mixed>
Get CAPTCHA token
getUrl()  : string|null
Get CAPTCHA URL
isUppercase()  : bool
Get CAPTCHA answer case
random()  : string
Create random alphanumeric string
setAnswer()  : Captcha
Set CAPTCHA answer
setConfig()  : Captcha
Set CAPTCHA image config
setExpire()  : Captcha
Set CAPTCHA expiration
setLength()  : Captcha
Set CAPTCHA answer length
setReload()  : Captcha
Set CAPTCHA reload text
setUppercase()  : Captcha
Set CAPTCHA answer case
setUrl()  : Captcha
Set CAPTCHA URL

Properties

$answer

CAPTCHA answer length

protected string|null $answer = null

$config

CAPTCHA image config

protected array<string|int, mixed> $config = ['adapter' => 'Gd', 'width' => 71, 'height' => 26, 'lineSpacing' => 5, 'lineColor' => [175, 175, 175], 'textColor' => [0, 0, 0], 'font' => null, 'size' => 0, 'rotate' => 0]

$expire

CAPTCHA expiration

protected int $expire = 300

$length

CAPTCHA length

protected int $length = 4

$reload

CAPTCHA reload text

protected string $reload = 'Reload'

$token

Current token data

protected array<string|int, mixed> $token = []

$uppercase

CAPTCHA uppercase flag

protected bool $uppercase = true

$url

CAPTCHA URL

protected string|null $url = null

Methods

__construct()

Constructor

public __construct(string $url[, int $expire = 300 ][, array<string|int, mixed>|null $config = null ]) : mixed

Instantiate the captcha image object

Parameters
$url : string
$expire : int = 300
$config : array<string|int, mixed>|null = null

__toString()

Print out the image

public __toString() : string
Return values
string

getAnswer()

Get CAPTCHA answer

public getAnswer() : string|null
Return values
string|null

getConfig()

Get CAPTCHA image config

public getConfig() : array<string|int, mixed>
Return values
array<string|int, mixed>

getExpire()

Get CAPTCHA expiration

public getExpire() : int
Return values
int

getImageHtml()

Get CAPTCHA image HTML

public getImageHtml() : string
Return values
string

getLength()

Get CAPTCHA answer length

public getLength() : int
Return values
int

getReload()

Get CAPTCHA reload text

public getReload() : string
Return values
string

getToken()

Get CAPTCHA token

public getToken() : array<string|int, mixed>
Return values
array<string|int, mixed>

getUrl()

Get CAPTCHA URL

public getUrl() : string|null
Return values
string|null

isUppercase()

Get CAPTCHA answer case

public isUppercase() : bool
Return values
bool

random()

Create random alphanumeric string

public random([int $length = 8 ][, bool $case = false ]) : string
Parameters
$length : int = 8
$case : bool = false
Return values
string

setAnswer()

Set CAPTCHA answer

public setAnswer(string $answer) : Captcha
Parameters
$answer : string
Return values
Captcha

setConfig()

Set CAPTCHA image config

public setConfig(array<string|int, mixed> $config) : Captcha
Parameters
$config : array<string|int, mixed>
Return values
Captcha

setExpire()

Set CAPTCHA expiration

public setExpire(int $expire) : Captcha
Parameters
$expire : int
Return values
Captcha

setLength()

Set CAPTCHA answer length

public setLength(int $length) : Captcha
Parameters
$length : int
Return values
Captcha

setReload()

Set CAPTCHA reload text

public setReload(string $reload) : Captcha
Parameters
$reload : string
Return values
Captcha

setUppercase()

Set CAPTCHA answer case

public setUppercase(bool $uppercase) : Captcha
Parameters
$uppercase : bool
Return values
Captcha

setUrl()

Set CAPTCHA URL

public setUrl(string $url) : Captcha
Parameters
$url : string
Return values
Captcha

        
On this page

Search results