Service/ReCaptcha/MailHide.php
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 [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Service
- Subpackage
- ReCaptcha
\Zend_Service_ReCaptcha_MailHide
Zend_Service_ReCaptcha_MailHide
- Parent(s)
- \Zend_Service_ReCaptcha < \Zend_Service_Abstract
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Version
- $Id: MailHide.php 24593 2012-01-05 20:35:02Z matthew $
Constants
string
API_SERVER
= 'http://www.google.com/recaptcha/api'
- Inherited_from
- \Zend_Service_ReCaptcha::API_SERVER
- string
string
API_SECURE_SERVER
= 'https://www.google.com/recaptcha/api'
- Inherited_from
- \Zend_Service_ReCaptcha::API_SECURE_SERVER
- string
string
VERIFY_SERVER
= 'http://www.google.com/recaptcha/api/verify'
- Inherited_from
- \Zend_Service_ReCaptcha::VERIFY_SERVER
- string
Properties

\Zend_Http_Client $_httpClient = nullHTTP Client used to query all web services
Inherited from: \Zend_Service_Abstract::$$_httpClient\Zend_Service_ReCaptcha::$$_httpClientnullDetails- Type
- \Zend_Http_Client
- Inherited_from
- \Zend_Service_Abstract::$$_httpClient
- Inherited_from
- \Zend_Service_ReCaptcha::$$_httpClient

string $_ip = null
nullDetails- Type
- string
- Inherited_from
- \Zend_Service_ReCaptcha::$$_ip

array $_options = array('theme' => 'red', 'lang' => 'en')
See the different options on http://recaptcha.net/apidocs/captcha/client.html
array('theme' => 'red', 'lang' => 'en')Details- Type
- array
- Inherited_from
- \Zend_Service_ReCaptcha::$$_options

array $_params = array('ssl' => false, 'error' => null, 'xhtml' => false)
array('ssl' => false, 'error' => null, 'xhtml' => false)Details- Type
- array
- Inherited_from
- \Zend_Service_ReCaptcha::$$_params

string $_privateKey = nullPrivate key used when verifying user input
Inherited from: \Zend_Service_ReCaptcha::$$_privateKeynullDetails- Type
- string
- Inherited_from
- \Zend_Service_ReCaptcha::$$_privateKey

string $_privateKeyPacked = nullBinary representation of the private key
nullDetails- Type
- string

string $_publicKey = nullPublic key used when displaying the captcha
Inherited from: \Zend_Service_ReCaptcha::$$_publicKeynullDetails- Type
- string
- Inherited_from
- \Zend_Service_ReCaptcha::$$_publicKey

\Zend_Service_ReCaptcha_Response $_response = null
nullDetails- Type
- \Zend_Service_ReCaptcha_Response
- Inherited_from
- \Zend_Service_ReCaptcha::$$_response
Methods

__construct(string $publicKey = null, string $privateKey = null, string $email = null, array | \Zend_Config $options = null) : voidLocal constructor
| Name | Type | Description |
|---|---|---|
| $publicKey | string | |
| $privateKey | string | |
| string | ||
| $options | array | \Zend_Config |

__toString() : stringSerialize as 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.
| Type | Description |
|---|---|
| string |

_getUrl() : stringGet the url used on the "hidden" part of the email address
| Type | Description |
|---|---|
| string |

_post(string $challengeField, string $responseField) : \Zend_Http_Response
| Name | Type | Description |
|---|---|---|
| $challengeField | string | |
| $responseField | string |
| Type | Description |
|---|---|
| \Zend_Http_Response |
| Exception | Description |
|---|---|
| \Zend_Service_ReCaptcha_Exception |

_requireMcrypt() : voidSee if the mcrypt extension is available
| Exception | Description |
|---|---|
| \Zend_Service_ReCaptcha_MailHide_Exception |

getEmailDomainPart() : stringGet the domain part of the email address
| Type | Description |
|---|---|
| string |

getEmailValidator() : \Zend_Validate_InterfaceGet emailValidator
| Type | Description |
|---|---|
| \Zend_Validate_Interface |

getHtml(string $email = null) : stringGet the HTML code needed for the mail hide
This method uses the public key to fetch a recaptcha form.
| Name | Type | Description |
|---|---|---|
| string |
| Type | Description |
|---|---|
| string |
| Exception | Description |
|---|---|
| \Zend_Service_ReCaptcha_MailHide_Exception |

getHttpClient() : \Zend_Http_ClientGets the HTTP client object.
Inherited from: \Zend_Service_Abstract::getHttpClient()\Zend_Service_ReCaptcha::getHttpClient()| Type | Description |
|---|---|
| \Zend_Http_Client |

getOption(string $key) : mixed
| Name | Type | Description |
|---|---|---|
| $key | string |
| Type | Description |
|---|---|
| mixed |

getParam(string $key) : mixed
| Name | Type | Description |
|---|---|---|
| $key | string |
| Type | Description |
|---|---|
| mixed |

setEmail(string $email) : \Zend_Service_ReCaptcha_MailHideSet the email property
This method will set the email property along with the local and domain parts
| Name | Type | Description |
|---|---|---|
| string |
| Type | Description |
|---|---|
| \Zend_Service_ReCaptcha_MailHide |

setEmailValidator(\Zend_Validate_Interface $validator) : \Zend_Service_ReCaptcha_MailHideSet email validator
| Name | Type | Description |
|---|---|---|
| $validator | \Zend_Validate_Interface |
| Type | Description |
|---|---|
| \Zend_Service_ReCaptcha_MailHide |

setHttpClient(\Zend_Http_Client $httpClient) : voidSets the HTTP client object to use for retrieving the feeds.
Inherited from: \Zend_Service_Abstract::setHttpClient()\Zend_Service_ReCaptcha::setHttpClient()If none is set, the default Zend_Http_Client will be used.
| Name | Type | Description |
|---|---|---|
| $httpClient | \Zend_Http_Client |

setIp(string $ip) : \Zend_Service_ReCaptcha
| Name | Type | Description |
|---|---|---|
| $ip | string |
| Type | Description |
|---|---|
| \Zend_Service_ReCaptcha |

setOption(string $key, string $value) : \Zend_Service_ReCaptcha
| Name | Type | Description |
|---|---|---|
| $key | string | |
| $value | string |
| Type | Description |
|---|---|
| \Zend_Service_ReCaptcha |

setOptions(array | \Zend_Config $options) : \Zend_Service_ReCaptcha
| Name | Type | Description |
|---|---|---|
| $options | array | \Zend_Config |
| Type | Description |
|---|---|
| \Zend_Service_ReCaptcha |
| Exception | Description |
|---|---|
| \Zend_Service_ReCaptcha_Exception |

setParam(string $key, string $value) : \Zend_Service_ReCaptcha
| Name | Type | Description |
|---|---|---|
| $key | string | |
| $value | string |
| Type | Description |
|---|---|
| \Zend_Service_ReCaptcha |

setParams(array | \Zend_Config $params) : \Zend_Service_ReCaptcha
| Name | Type | Description |
|---|---|---|
| $params | array | \Zend_Config |
| Type | Description |
|---|---|
| \Zend_Service_ReCaptcha |
| Exception | Description |
|---|---|
| \Zend_Service_ReCaptcha_Exception |

setPrivateKey(string $privateKey) : \Zend_Service_ReCaptcha_MailHideOverride the setPrivateKey method
Override the parent method to store a binary representation of the private key as well.
| Name | Type | Description |
|---|---|---|
| $privateKey | string |
| Type | Description |
|---|---|
| \Zend_Service_ReCaptcha_MailHide |

setPublicKey(string $publicKey) : \Zend_Service_ReCaptcha
| Name | Type | Description |
|---|---|---|
| $publicKey | string |
| Type | Description |
|---|---|
| \Zend_Service_ReCaptcha |

verify(string $challengeField, string $responseField) : \Zend_Service_ReCaptcha_Response
This method calls up the post method and returns a Zend_Service_ReCaptcha_Response object.
| Name | Type | Description |
|---|---|---|
| $challengeField | string | |
| $responseField | string |
| Type | Description |
|---|---|
| \Zend_Service_ReCaptcha_Response |