Class Zend_Service_ReCaptcha

Description

Zend_Service_ReCaptcha

  • version: $Id: ReCaptcha.php 20096 2010-01-06 02:05:09Z bkarwin $
  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /Service/ReCaptcha.php (line 41)

Zend_Service_Abstract
   |
   --Zend_Service_ReCaptcha
Direct descendents
Class Description
 class Zend_Service_ReCaptcha_MailHide Zend_Service_ReCaptcha_MailHide
Class Constant Summary
 API_SECURE_SERVER = 'https://api-secure.recaptcha.net'
 API_SERVER = 'http://api.recaptcha.net'
 VERIFY_SERVER = 'http://api-verify.recaptcha.net/verify'
Variable Summary
Method Summary
 Zend_Service_ReCaptcha __construct ([string $publicKey = null], [string $privateKey = null], [array|Zend_Config $params = null], [array $options = null], [string $ip = null])
 string getHtml ()
 string getIp ()
 mixed getOption (string $key)
 array getOptions ()
 mixed getParam (string $key)
 array getParams ()
 string getPrivateKey ()
 string getPublicKey ()
 Zend_Service_ReCaptcha setOption (string $key, string $value)
 Zend_Service_ReCaptcha setParam (string $key, string $value)
 Zend_Service_ReCaptcha setPrivateKey (string $privateKey)
 Zend_Service_ReCaptcha setPublicKey (string $publicKey)
 Zend_Service_ReCaptcha_Response verify (string $challengeField, string $responseField)
 Zend_Http_Response _post (string $challengeField, string $responseField)
 string __toString ()
Variables
string $_ip = null (line 83)

Ip address used when verifying user input

  • access: protected
array $_options = array(
'theme' => 'red',
'lang' => 'en',
)
(line 105)

Options for tailoring reCaptcha

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

  • access: protected
array $_params = array(
'ssl' => false, /* Use SSL or not when generating the recaptcha */
'error' => null, /* The error message to display in the recaptcha */
'xhtml' => false /* Enable XHTML output (this will not be XHTML Strict
compliant since the IFRAME is necessary when
Javascript is disabled) */
)
(line 90)

Parameters for the object

  • access: protected
string $_privateKey = null (line 76)

Private key used when verifying user input

  • access: protected
string $_publicKey = null (line 69)

Public key used when displaying the captcha

  • access: protected
Zend_Service_ReCaptcha_Response $_response = null (line 115)

Response from the verify server

  • access: protected

Inherited Variables

Inherited from Zend_Service_Abstract

Zend_Service_Abstract::$_httpClient
Methods
Constructor __construct (line 127)

Class constructor

  • access: public
Zend_Service_ReCaptcha __construct ([string $publicKey = null], [string $privateKey = null], [array|Zend_Config $params = null], [array $options = null], [string $ip = null])
  • string $publicKey
  • string $privateKey
  • array|Zend_Config $params
  • array $options
  • string $ip

Redefined in descendants as:
getHtml (line 379)

Get the HTML code for the captcha

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

  • throws: Zend_Service_ReCaptcha_Exception
  • access: public
string getHtml ()

Redefined in descendants as:
getIp (line 192)

Get the ip property

  • access: public
string getIp ()
getOption (line 320)

Get a single option

  • access: public
mixed getOption (string $key)
  • string $key
getOptions (line 309)

Get the options array

  • access: public
array getOptions ()
getParam (line 256)

Get a single parameter

  • access: public
mixed getParam (string $key)
  • string $key
getParams (line 245)

Get the parameter array

  • access: public
array getParams ()
getPrivateKey (line 353)

Get the private key

  • access: public
string getPrivateKey ()
getPublicKey (line 330)

Get the public key

  • access: public
string getPublicKey ()
setIp (line 180)

Set the ip property

  • access: public
Zend_Service_ReCaptcha setIp (string $ip)
  • string $ip
setOption (line 268)

Set a single option

  • access: public
Zend_Service_ReCaptcha setOption (string $key, string $value)
  • string $key
  • string $value
setOptions (line 282)

Set options

  • throws: Zend_Service_ReCaptcha_Exception
  • access: public
Zend_Service_ReCaptcha setOptions (array|Zend_Config $options)
setParam (line 204)

Set a single parameter

  • access: public
Zend_Service_ReCaptcha setParam (string $key, string $value)
  • string $key
  • string $value
setParams (line 218)

Set parameters

  • throws: Zend_Service_ReCaptcha_Exception
  • access: public
Zend_Service_ReCaptcha setParams (array|Zend_Config $params)
setPrivateKey (line 364)

Set the private key

  • access: public
Zend_Service_ReCaptcha setPrivateKey (string $privateKey)
  • string $privateKey

Redefined in descendants as:
setPublicKey (line 341)

Set the public key

  • access: public
Zend_Service_ReCaptcha setPublicKey (string $publicKey)
  • string $publicKey
verify (line 500)

Verify the user input

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

  • access: public
Zend_Service_ReCaptcha_Response verify (string $challengeField, string $responseField)
  • string $challengeField
  • string $responseField
_post (line 447)

Post a solution to the verify server

  • throws: Zend_Service_ReCaptcha_Exception
  • access: protected
Zend_Http_Response _post (string $challengeField, string $responseField)
  • string $challengeField
  • string $responseField
__toString (line 162)

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.

  • access: public
string __toString ()

Redefined in descendants as:

Inherited Methods

Inherited From Zend_Service_Abstract

 Zend_Service_Abstract::getHttpClient()
 Zend_Service_Abstract::setHttpClient()
Class Constants
API_SECURE_SERVER = 'https://api-secure.recaptcha.net' (line 55)

URI to the secure API

API_SERVER = 'http://api.recaptcha.net' (line 48)

URI to the regular API

VERIFY_SERVER = 'http://api-verify.recaptcha.net/verify' (line 62)

URI to the verify server

Documentation generated on Mon, 21 Jun 2010 15:41:20 -0400 by phpDocumentor 1.4.3