Documentation

SocketPost
in package
implements RequestMethod

Sends a POST request to the reCAPTCHA service, but makes use of fsockopen() instead of get_file_contents(). This is to account for people who may be on servers where allow_url_open is disabled.

Table of Contents

Interfaces

RequestMethod
Method used to send the request to the service.

Properties

$socket  : Socket
Socket to the reCAPTCHA service

Methods

__construct()  : mixed
Only needed if you want to override the defaults
submit()  : string
Submit the POST request with the specified parameters.

Properties

Methods

__construct()

Only needed if you want to override the defaults

public __construct([Socket $socket = null ][, string $siteVerifyUrl = null ]) : mixed
Parameters
$socket : Socket = null

optional socket, injectable for testing

$siteVerifyUrl : string = null

URL for reCAPTCHA siteverify API

submit()

Submit the POST request with the specified parameters.

public submit(RequestParameters $params) : string
Parameters
$params : RequestParameters

Request parameters

Return values
string

Body of the reCAPTCHA response


        
On this page

Search results