PHPackages                             browserlife/zf2-recaptcha - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. browserlife/zf2-recaptcha

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

browserlife/zf2-recaptcha
=========================

ReCaptcha v2.0 module for Zend Framework 2 (ZF2)

v1.0.1(10y ago)419.9k2[1 issues](https://github.com/malganis93/BrlReCaptcha/issues)MITPHPPHP &gt;=5.3.0

Since May 9Pushed 10y ago2 watchersCompare

[ Source](https://github.com/malganis93/BrlReCaptcha)[ Packagist](https://packagist.org/packages/browserlife/zf2-recaptcha)[ Docs](https://github.com/malganis93/BrlReCaptcha)[ RSS](/packages/browserlife-zf2-recaptcha/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (4)Used By (0)

BrlReCaptcha - A ZF2 Module for Google ReCaptchaV2
==================================================

[](#brlrecaptcha---a-zf2-module-for-google-recaptchav2)

Build Status: [![build status](https://camo.githubusercontent.com/9467fc36bfa8a46984d500423d90816f6a7188058302a41ea6ba7a61c2626893/68747470733a2f2f63692e62726f777365726c6966652e64652f70726f6a656374732f312f7374617475732e706e673f7265663d6d6173746572)](https://ci.browserlife.de/projects/1?ref=master)

This modules makes it possible to use the new ReCaptcha [LINK](https://www.google.com/recaptcha) in your ZendFramework2 (ZF2) projects.

I created this module, since [ZendFrameworkService\\ReCaptcha](https://github.com/zendframework/ZendService_ReCaptcha) seems to be dead and is still on RCv1.

Installation
------------

[](#installation)

### with composer

[](#with-composer)

Just add the following line to your requirements:

```
"browserlife/zf2-recaptcha": "dev-master"
```

and run

```
php composer.phar update
```

Since there are problems with the SSL-Cert if you use Adapter\\Socket, please install php-curl!

Then activate the module in your application.config.php :

```
```php
return array(
    'modules' => array(
        // ...
        'BrlReCaptcha',
    ),
    // ...
);
```

```

Get your private-key
--------------------

[](#get-your-private-key)

To use this service, you have to register at [Google ReCaptcha](https://www.google.com/recaptcha) using your Google-Account.

Usage
-----

[](#usage)

### with Zend\\From

[](#with-zendfrom)

This module works similar as [ZendFrameworkService\\ReCaptcha](https://github.com/zendframework/ZendService_ReCaptcha).

Just add the following lines to your form creation:

```
$element = new \Zend\Captcha\Captcha('g-recaptcha-response');
$element->setCaptcha(new BrlReCaptcha\ReCaptcha(array('private_key' => 'YOUR_SECRET FROM GOOGLE', 'public_key' => 'YOUR_PUBLIC_KEY', 'theme' => 'dark')));
$form->add($element);

```

Important: The element has to be named g-recaptcha-response due to the reason that the JS from google creates this virtual input.

Remember to add this element to your validationChain as well.

Note: The theme parameter is not required. By default the light theme is used.

It acts the same way as any other built-in captcha solution.

### with ServiceManager

[](#with-servicemanager)

If you like to implement the view on your own, just use the Service\\ReCaptchaService. It handles the whole communication between your code and the ReCaptcha API.

```
$recaptcha = $serviceLocator->get('BrlRecaptcha\Service\ReCaptcha');

```

### other

[](#other)

just look into the sources! It's pretty easy to understand.

TODO
----

[](#todo)

- PHPUnit Tests are missing -&gt; Will do this in the next couple of days
- some error handling is qnd
- better documentation

Questions?
----------

[](#questions)

If you have any problems or questions regarding my code, please create an issue. Since i'm using this module for my own projects i'm interested in keeping this up to date!

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 95.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~172 days

Total

2

Last Release

3855d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/158e62df0af9307494c2511db829b24b517383e2ca993622c2b420d839c62a73?d=identicon)[malganis93](/maintainers/malganis93)

---

Top Contributors

[![malganis93](https://avatars.githubusercontent.com/u/1519805?v=4)](https://github.com/malganis93 "malganis93 (23 commits)")[![tdutrion](https://avatars.githubusercontent.com/u/1712222?v=4)](https://github.com/tdutrion "tdutrion (1 commits)")

---

Tags

recaptchacaptchazf2

### Embed Badge

![Health badge](/badges/browserlife-zf2-recaptcha/health.svg)

```
[![Health](https://phpackages.com/badges/browserlife-zf2-recaptcha/health.svg)](https://phpackages.com/packages/browserlife-zf2-recaptcha)
```

###  Alternatives

[google/recaptcha

Client library for reCAPTCHA, a free service that protects websites from spam and abuse.

3.6k89.1M222](/packages/google-recaptcha)[anhskohbo/no-captcha

No CAPTCHA reCAPTCHA For Laravel.

1.8k8.5M33](/packages/anhskohbo-no-captcha)[albertcht/invisible-recaptcha

Invisible reCAPTCHA For Laravel.

6031.6M6](/packages/albertcht-invisible-recaptcha)[josiasmontag/laravel-recaptchav3

Recaptcha V3 for Laravel package

2641.6M2](/packages/josiasmontag-laravel-recaptchav3)[arcanedev/no-captcha

No CAPTCHA (new Google reCAPTCHA) with Laravel support

370730.4k6](/packages/arcanedev-no-captcha)[buzz/laravel-google-captcha

Google captcha for Laravel

2071.1M2](/packages/buzz-laravel-google-captcha)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
