category |
Zend |
package |
Zend_Service |
subpackage |
ReCaptcha |
copyright |
Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license |
New BSD License |
version |
$Id$ |
inherited_from |
\Zend_Service_ReCaptcha |
Methods
Local constructor
__construct(string $publicKey = null
, string $privateKey = null
, string $email = null
, array|\Zend_Config $options = null
)
inherited_from |
\Zend_Service_ReCaptcha::__construct() |
Parameters
$publicKey
string
$privateKey
string
$email
string
$options
array
\Zend_Config
Class constructor
__construct(string $publicKey = null
, string $privateKey = null
, array|\Zend_Config $params = null
, array $options = null
, string $ip = null
)
Inherited
Parameters
$publicKey
string
$privateKey
string
$params
array
array
\Zend_Config
$options
array
$ip
string
Serialize as string
__toString() : string
When the instance is used as a string it will display the email address. Since we can't
throw exceptions within this method we will trigger a user warning instead.
inherited_from |
\Zend_Service_ReCaptcha::__toString() |
Returns
string
Serialize as string
__toString() : string
Inherited
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.
Returns
string
Get the default set of parameters
getDefaultOptions() : array
Get the email property
getEmail() : string
Get the domain part of the email address
getEmailDomainPart() : string
Get the local part of the email address
getEmailLocalPart() : string
Get emailValidator
getEmailValidator() : \Zend_Validate_Interface
Returns
\Zend_Validate_Interface
Get the HTML code needed for the mail hide
getHtml(string $email = null
) : string
This method uses the public key to fetch a recaptcha form.
inherited_from |
\Zend_Service_ReCaptcha::getHtml() |
Parameters
$email
string
Exceptions
\Zend_Service_ReCaptcha_MailHide_Exception |
|
Returns
string
Get the HTML code for the captcha
getHtml(null|string $name = null
) : string
Inherited
This method uses the public key to fetch a recaptcha form.
Parameters
$name
null
string
Base name for recaptcha form elements
Exceptions
\Zend_Service_ReCaptcha_Exception |
|
Returns
string
Gets the HTTP client object.
getHttpClient() : \Zend_Http_Client
InheritedStatic
Returns
\Zend_Http_Client
Get the ip property
getIp() : string
Inherited
Get a single option
getOption(string $key) : mixed
Inherited
Parameters
$key
string
Returns
mixed
Get the options array
getOptions() : array
Inherited
Get a single parameter
getParam(string $key) : mixed
Inherited
Parameters
$key
string
Returns
mixed
Get the parameter array
getParams() : array
Inherited
Get the private key
getPrivateKey() : string
Inherited
Get the public key
getPublicKey() : string
Inherited
Set the email property
setEmail(string $email) : \Zend_Service_ReCaptcha_MailHide
This method will set the email property along with the local and domain parts
Parameters
$email
string
Returns
\Zend_Service_ReCaptcha_MailHide
Set email validator
setEmailValidator(\Zend_Validate_Interface $validator) : \Zend_Service_ReCaptcha_MailHide
Parameters
$validator
\Zend_Validate_Interface
Returns
\Zend_Service_ReCaptcha_MailHide
Sets the HTTP client object to use for retrieving the feeds. If none
is set, the default Zend_Http_Client will be used.
setHttpClient(\Zend_Http_Client $httpClient)
InheritedStatic
Parameters
$httpClient
\Zend_Http_Client
Set the ip property
setIp(string $ip) : \Zend_Service_ReCaptcha
Inherited
Parameters
$ip
string
Returns
\Zend_Service_ReCaptcha
Set a single option
setOption(string $key, string $value) : \Zend_Service_ReCaptcha
Inherited
Parameters
$key
string
$value
string
Returns
\Zend_Service_ReCaptcha
Set options
setOptions(array|\Zend_Config $options) : \Zend_Service_ReCaptcha
Inherited
Parameters
$options
array
\Zend_Config
Exceptions
\Zend_Service_ReCaptcha_Exception |
|
Returns
\Zend_Service_ReCaptcha
Set a single parameter
setParam(string $key, string $value) : \Zend_Service_ReCaptcha
Inherited
Parameters
$key
string
$value
string
Returns
\Zend_Service_ReCaptcha
Set parameters
setParams(array|\Zend_Config $params) : \Zend_Service_ReCaptcha
Inherited
Parameters
$params
array
\Zend_Config
Exceptions
\Zend_Service_ReCaptcha_Exception |
|
Returns
\Zend_Service_ReCaptcha
Override the setPrivateKey method
setPrivateKey(string $privateKey) : \Zend_Service_ReCaptcha_MailHide
Override the parent method to store a binary representation of the private key as well.
inherited_from |
\Zend_Service_ReCaptcha::setPrivateKey() |
Parameters
$privateKey
string
Returns
\Zend_Service_ReCaptcha_MailHide
Set the private key
setPrivateKey(string $privateKey) : \Zend_Service_ReCaptcha
Inherited
Parameters
$privateKey
string
Returns
\Zend_Service_ReCaptcha
Set the public key
setPublicKey(string $publicKey) : \Zend_Service_ReCaptcha
Inherited
Parameters
$publicKey
string
Returns
\Zend_Service_ReCaptcha
Verify the user input
verify(string $challengeField, string $responseField) : \Zend_Service_ReCaptcha_Response
Inherited
This method calls up the post method and returns a
Zend_Service_ReCaptcha_Response object.
Parameters
$challengeField
string
$responseField
string
Returns
\Zend_Service_ReCaptcha_Response
Get the url used on the "hidden" part of the email address
_getUrl() : string
Post a solution to the verify server
_post(string $challengeField, string $responseField) : \Zend_Http_Response
Inherited
Parameters
$challengeField
string
$responseField
string
Exceptions
\Zend_Service_ReCaptcha_Exception |
|
Returns
\Zend_Http_Response
See if the mcrypt extension is available
_requireMcrypt()
Exceptions
\Zend_Service_ReCaptcha_MailHide_Exception |
|
Properties
The email address to protect
$_email : string
The domain part of the email
$_emailDomainPart : string
The local part of the email
$_emailLocalPart : string
$_emailValidator
$_emailValidator : \Zend_Validate_Interface
HTTP Client used to query all web services
$_httpClient : \Zend_Http_Client
Static
Ip address used when verifying user input
$_ip : string
Options for tailoring reCaptcha
$_options : array
Default
array('theme' => 'red', 'lang' => 'en', 'custom_translations' => array())
Parameters for the object
$_params : array
Default
array('ssl' => false, 'error' => null, 'xhtml' => false)
Private key used when verifying user input
$_privateKey : string
Binary representation of the private key
$_privateKeyPacked : string
Public key used when displaying the captcha
$_publicKey : string
Response from the verify server
$_response : \Zend_Service_ReCaptcha_Response
Constants
URI to the secure API
API_SECURE_SERVER = 'https://www.google.com/recaptcha/api' : string
URI to the regular API
API_SERVER = 'http://www.google.com/recaptcha/api' : string
ENCRYPTION_BLOCK_SIZE
ENCRYPTION_BLOCK_SIZE = 16
ENCRYPTION_CIPHER
ENCRYPTION_CIPHER = MCRYPT_RIJNDAEL_128
ENCRYPTION_IV
ENCRYPTION_IV = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
ENCRYPTION_MODE
ENCRYPTION_MODE = MCRYPT_MODE_CBC
Url to the mailhide server
MAILHIDE_SERVER = 'http://mailhide.recaptcha.net/d' : string
URI to the verify server
VERIFY_SERVER = 'http://www.google.com/recaptcha/api/verify' : string