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
string API_SERVER = 'http://api.recaptcha.net'
URI to the regular API
string API_SECURE_SERVER = 'https://api-secure.recaptcha.net'
URI to the secure API
string VERIFY_SERVER = 'http://api-verify.recaptcha.net/verify'
URI to the verify server
string $_ip = 'null'
Ip address used when verifying user input
array $_options = 'array'
Options for tailoring reCaptcha
See the different options on http://recaptcha.net/apidocs/captcha/client.html
array $_params = 'array'
Parameters for the object
string $_privateKey = 'null'
Private key used when verifying user input
string $_publicKey = 'null'
Public key used when displaying the captcha
Zend_Service_ReCaptcha_Response $_response = 'null'
Response from the verify server
__construct(
string $publicKey
=
null, string $privateKey
=
null, array|array|Zend_Config $params
=
null, array $options
=
null, string $ip
=
null
)
:
Class constructor
__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.
_post(
string $challengeField, string $responseField
)
:
Zend_Http_Response
Post a solution to the verify server
getHtml(
)
:
string
Get the HTML code for the captcha
This method uses the public key to fetch a recaptcha form.
getIp(
)
:
string
Get the ip property
getOption(
string $key
)
:
mixed
Get a single option
getOptions(
)
:
array
Get the options array
getParam(
string $key
)
:
mixed
Get a single parameter
getParams(
)
:
array
Get the parameter array
getPrivateKey(
)
:
string
Get the private key
getPublicKey(
)
:
string
Get the public key
setIp(
string $ip
)
:
Zend_Service_ReCaptcha
Set the ip property
setOption(
string $key, string $value
)
:
Zend_Service_ReCaptcha
Set a single option
setOptions(
array|Zend_Config $options
)
:
Zend_Service_ReCaptcha
Set options
setParam(
string $key, string $value
)
:
Zend_Service_ReCaptcha
Set a single parameter
setParams(
array|Zend_Config $params
)
:
Zend_Service_ReCaptcha
Set parameters
setPrivateKey(
string $privateKey
)
:
Zend_Service_ReCaptcha
Set the private key
setPublicKey(
string $publicKey
)
:
Zend_Service_ReCaptcha
Set the public key
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.