2017 © Pedro Peláez
 

library recaptcha2

reCAPTCHA 2.0 ("NoCaptcha") Module for Zend Framework 2 and Zend Framework 3

image

breyndotechse/recaptcha2

reCAPTCHA 2.0 ("NoCaptcha") Module for Zend Framework 2 and Zend Framework 3

  • Wednesday, September 21, 2016
  • by BreyndotEchse
  • Repository
  • 1 Watchers
  • 0 Stars
  • 719 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 26 % Grown

The README.md

reCAPTCHA 2.0 ("NoCaptcha") Module for Zend Framework 2 and Zend Framework 3

Build Status Coverage Status Scrutinizer Code Quality Packagist, (*1)

Installation

Installation of this module uses composer. For composer documentation, please refer to getcomposer.org., (*2)

php composer.phar require breyndotechse/recaptcha2

Then add ReCaptcha2 to your config/application.config.php., (*3)

Usage

Basic Usage

use ReCaptcha2\Captcha\ReCaptcha2;
use Zend\Form\Element;
use Zend\Form\Form;

//...
$form->add([
    'name' => 'captcha',
    'type' => Element\Captcha::class,
    'options' => [
        'captcha' => [
            'class' => ReCaptcha2::class,
            'options' => [
                'siteKey' => '<siteKey>',
                'secretKey' => '<secretKey>',
            ],
        ],
    ],
]);

Advanced configuration

use ReCaptcha2\Captcha\NoCaptchaService;
use ReCaptcha2\Captcha\ReCaptcha2;
use Zend\Form\Element;
use Zend\Form\Form;
use Zend\Http\Client;

//...
$form->add([
    'name' => 'captcha',
    'type' => Element\Captcha::class,
    'options' => [
        'captcha' => [
            'class' => ReCaptcha2::class,                   // Required
            'options' => [
                // Required:
                'siteKey' => '<siteKey>',
                'secretKey' => '<secretKey>',
                // Optional:
                'service' => [
                    'class' => NoCaptchaService::class,     //Default = ReCaptcha2\Captcha\NoCaptchaService
                    'options' => [
                        'httpClient' => [
                            'class' => Client::class,       //Default = Zend\Http\Client
                            'options' => [
                                //Zend\Http\Client configuration
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],
]);

SSL Issue / Google SSL Certificate

PHP Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

Set the openssl.cafile configuration setting in your php.ini, .user.ini or .htaccess. You can find a bundle of CA certificates here: cURL CA Certificate Bundle. This module comes with a cacert.pem file containing the "Google Internet Authority G2" and the "GeoTrust Global CA" CA certificate., (*4)

Otherwise set the Zend\Http\Client sslcafile configuration key:, (*5)

$form->add([
    'name' => 'captcha',
    'type' => Element\Captcha::class,
    'options' => [
        'captcha' => [
            'class' => ReCaptcha2::class,
            'options' => [
                'siteKey' => '<siteKey>',
                'secretKey' => '<secretKey>',
                'service' => [
                    'options' => [
                        'httpClient' => [
                            'options' => [
                                'sslcafile' => ReCaptcha2\Captcha\NoCaptchaService::CACERT_PATH,
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],
]);

The Versions

21/09 2016

dev-master

9999999-dev https://github.com/breyndotechse/recaptcha2

reCAPTCHA 2.0 ("NoCaptcha") Module for Zend Framework 2 and Zend Framework 3

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

framework zf2 zend captcha zendframework zf3 recaptcha nocaptcha

21/09 2016

1.0.3

1.0.3.0 https://github.com/breyndotechse/recaptcha2

reCAPTCHA 2.0 ("NoCaptcha") Module for Zend Framework 2 and Zend Framework 3

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

framework zf2 zend captcha zendframework zf3 recaptcha nocaptcha