\Captcha\AdapterAyahAdapter

Provides "Are You A Human" CAPTCHA.

Usage

Method chaining style:

$valid = CaptchaManager::adapter('ayah')
    ->publisherKey('310203ef720d21451c2516f2633c645acadc225a')
    ->scoringKey('6233426d2e41a5c37d11c65202fa23c1fca50520')
    ->validate(($this->request);

Or passing as arguments:

$ayah = CaptchaManager::adapter('ayah', [
    'publisherKey' => '310203ef720d21451c2516f2633c645acadc225a',
    'scoringKey' => '6233426d2e41a5c37d11c65202fa23c1fca50520'
]);

$valid = $ayah->validate($this->request);

Summary

Methods
Properties
Constants
settings()
render()
validate()
publisherKey()
scoringKey()
__construct()
name()
No public properties found
No constants found
_getLib()
$_defaultConfig
N/A
No private methods found
No private properties found
N/A

Properties

$_defaultConfig

$_defaultConfig : array

Default configuration for this adapter.

Type

array

Methods

settings()

settings(\Cake\View\View $view) : string

Renders Form input elements for holding configurable parameters that users can tweak (private key, public key, etc).

Parameters

\Cake\View\View $view

The view instance for which form elements should be rendered

Returns

string —

HTML containing form inputs (text boxes, check boxes, etc)

render()

render(\Cake\View\View $view) : string

Renders the CAPTCHA element for later use in web form.

Parameters

\Cake\View\View $view

The view instance for which the CAPTCHA should be rendered

Returns

string —

HTML

validate()

validate(\Cake\Network\Request $request) : boolean

Validates the given POST information.

Parameters

\Cake\Network\Request $request

Current request object, commonly used to extract POST or Session information.

Returns

boolean —

True if valid, false otherwise

publisherKey()

publisherKey(string $key) : $this

Sets AYAH publisher key.

Parameters

string $key

The key

Returns

$this

scoringKey()

scoringKey(string $key) : $this

Sets AYAH scoring key.

Parameters

string $key

The key

Returns

$this

__construct()

__construct(array $config)

Constructor.

Parameters

array $config

Configurable options

name()

name(string|null $name) : string

Gets or set Adapter's name.

Parameters

string|null $name

The name to set, or null to get current name.

Returns

string —

Adapter name, e.g. reCAPTCHA

_getLib()

_getLib() : object

Gets an instance of AYAH library.

Returns

object