/** * Local constructor * * @param string $publicKey * @param string $privateKey * @param string $email * @param array|Zend_Config $options */ public function __construct($publicKey = null, $privateKey = null, $email = null, $options = null) { /* Require the mcrypt extension to be loaded */ $this->_requireMcrypt(); /* If options is a Zend_Config object we want to convert it to an array so we can merge it with the default options */ if ($options instanceof Zend_Config) { $options = $options->toArray(); } /* Merge if needed */ if (is_array($options)) { $options = array_merge($this->getDefaultOptions(), $options); } else { $options = $this->getDefaultOptions(); } parent::__construct($publicKey, $privateKey, null, $options); if ($email !== null) { $this->setEmail($email); } }
/** * Local constructor * * @param string $publicKey * @param string $privateKey * @param string $email * @param array|Zend_Config $options * @throws Zend_Service_ReCaptcha_MailHide_Exception */ public function __construct($publicKey = null, $privateKey = null, $email = null, $options = null) { if (!extension_loaded('mcrypt')) { /** @see Zend_Service_ReCaptcha_MailHide_Exception */ require_once 'Zend/Service/ReCaptcha/MailHide/Exception.php'; throw new Zend_Service_ReCaptcha_MailHide_Exception('Use of the Zend_Service_ReCaptcha_MailHide component requires the mcrypt extension to be enabled in PHP'); } /* If options is a Zend_Config object we want to convert it to an array so we can merge it with the default options */ if ($options instanceof Zend_Config) { $options = $options->toArray(); } /* Merge if needed */ if (is_array($options)) { $options = array_merge($this->getDefaultOptions(), $options); } else { $options = $this->getDefaultOptions(); } parent::__construct($publicKey, $privateKey, null, $options); if ($email !== null) { $this->setEmail($email); } }