API Documentation

Service/ReCaptcha.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Service
subpackage
ReCaptcha
Classes
Zend_Service_ReCaptcha

Description

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Zend_Service_ReCaptcha

Extends from
Zend_Service_Abstract
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Service
subpackage
ReCaptcha
version
$Id: ReCaptcha.php 20096 2010-01-06 02:05:09Z bkarwin $
Constants
API_SERVER
API_SECURE_SERVER
VERIFY_SERVER
Properties
$_publicKey
$_privateKey
$_ip
$_params
$_options
$_response
Methods
__construct
__toString
setIp
getIp
setParam
setParams
getParams
getParam
setOption
setOptions
getOptions
getOption
getPublicKey
setPublicKey
getPrivateKey
setPrivateKey
getHtml
_post
verify

Description

Zend_Service_ReCaptcha

Constants

API_SERVER

string API_SERVER = 'http://api.recaptcha.net'

URI to the regular API

Details

value
http://api.recaptcha.net
API_SERVER
string

API_SECURE_SERVER

string API_SECURE_SERVER = 'https://api-secure.recaptcha.net'

URI to the secure API

Details

value
https://api-secure.recaptcha.net
API_SECURE_SERVER
string

VERIFY_SERVER

string VERIFY_SERVER = 'http://api-verify.recaptcha.net/verify'

URI to the verify server

Details

value
http://api-verify.recaptcha.net/verify
VERIFY_SERVER
string

Properties

$_ip

string $_ip = 'null'

Ip address used when verifying user input

Details

$_ip
string
visibility
protected
default
null
final
false
static
false

$_options

array $_options = 'array'

Options for tailoring reCaptcha

See the different options on http://recaptcha.net/apidocs/captcha/client.html

Details

$_options
array
visibility
protected
default
array
final
false
static
false

$_params

array $_params = 'array'

Parameters for the object

Details

$_params
array
visibility
protected
default
array
final
false
static
false

$_privateKey

string $_privateKey = 'null'

Private key used when verifying user input

Details

$_privateKey
string
visibility
protected
default
null
final
false
static
false

$_publicKey

string $_publicKey = 'null'

Public key used when displaying the captcha

Details

$_publicKey
string
visibility
protected
default
null
final
false
static
false

$_response

Zend_Service_ReCaptcha_Response $_response = 'null'

Response from the verify server

Details

$_response
Zend_Service_ReCaptcha_Response
visibility
protected
default
null
final
false
static
false

Methods

__construct

__construct( string $publicKey = null, string $privateKey = null, array|array|Zend_Config $params = null, array $options = null, string $ip = null ) :

Class constructor

Arguments
$publicKey
string
$privateKey
string
$params
arrayarrayZend_Config
$options
array
$ip
string
Details
visibility
public
final
false
static
false

__toString

__toString( ) : string

Serialize as string

When the instance is used as a string it will display the recaptcha. Since we can't throw exceptions within this method we will trigger a user warning instead.

Output
string
Details
visibility
public
final
false
static
false

_post

_post( string $challengeField, string $responseField ) : Zend_Http_Response

Post a solution to the verify server

Arguments
$challengeField
string
$responseField
string
Details
visibility
protected
final
false
static
false
throws

getHtml

getHtml( ) : string

Get the HTML code for the captcha

This method uses the public key to fetch a recaptcha form.

Output
string
Details
visibility
public
final
false
static
false
throws

getIp

getIp( ) : string

Get the ip property

Output
string
Details
visibility
public
final
false
static
false

getOption

getOption( string $key ) : mixed

Get a single option

Arguments
$key
string
Output
mixed
Details
visibility
public
final
false
static
false

getOptions

getOptions( ) : array

Get the options array

Output
array
Details
visibility
public
final
false
static
false

getParam

getParam( string $key ) : mixed

Get a single parameter

Arguments
$key
string
Output
mixed
Details
visibility
public
final
false
static
false

getParams

getParams( ) : array

Get the parameter array

Output
array
Details
visibility
public
final
false
static
false

getPrivateKey

getPrivateKey( ) : string

Get the private key

Output
string
Details
visibility
public
final
false
static
false

getPublicKey

getPublicKey( ) : string

Get the public key

Output
string
Details
visibility
public
final
false
static
false

setIp

setIp( string $ip ) : Zend_Service_ReCaptcha

Set the ip property

Arguments
$ip
string
Details
visibility
public
final
false
static
false

setOption

setOption( string $key, string $value ) : Zend_Service_ReCaptcha

Set a single option

Arguments
$key
string
$value
string
Details
visibility
public
final
false
static
false

setOptions

setOptions( array|Zend_Config $options ) : Zend_Service_ReCaptcha

Set options

Arguments
$options
arrayZend_Config
Details
visibility
public
final
false
static
false
throws

setParam

setParam( string $key, string $value ) : Zend_Service_ReCaptcha

Set a single parameter

Arguments
$key
string
$value
string
Details
visibility
public
final
false
static
false

setParams

setParams( array|Zend_Config $params ) : Zend_Service_ReCaptcha

Set parameters

Arguments
$params
arrayZend_Config
Details
visibility
public
final
false
static
false
throws

setPrivateKey

setPrivateKey( string $privateKey ) : Zend_Service_ReCaptcha

Set the private key

Arguments
$privateKey
string
Details
visibility
public
final
false
static
false

setPublicKey

setPublicKey( string $publicKey ) : Zend_Service_ReCaptcha

Set the public key

Arguments
$publicKey
string
Details
visibility
public
final
false
static
false

verify

verify( string $challengeField, string $responseField ) : Zend_Service_ReCaptcha_Response

Verify the user input

This method calls up the post method and returns a Zend_Service_ReCaptcha_Response object.

Arguments
$challengeField
string
$responseField
string
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.