Download the PHP package vihuvac/recaptcha-bundle without Composer

On this page you can find all versions of the php package vihuvac/recaptcha-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package recaptcha-bundle

VihuvacRecaptchaBundle

:warning: DEPRECATED:

Unfortunately I want to inform this bundle is getting deprecated, I recommend using EWZRecaptchaBundle instead. Sorry for the inconvenience. :pensive:


This bundle provides easy reCAPTCHA form field for Symfony in order to protect your website from spam and abuse.

Latest Stable Version Latest Unstable Version Gitter License

Total Downloads Monthly Downloads Daily Downloads

Branch Travis Coveralls
master Build Status Coverage Status

Installation

Step 1: Using composer and enable the Bundle

To install the bundle via composer, just run from the command line (terminal):

Composer will automatically download all the required files, and install them for you. All that is left to do is to update your file, and register the new bundle:

Step 2: Configure the bundle

Add the following to your config file:

NOTE:

This bundle uses a secure API (HTTPS Protocol). Google API solves the requests by the Browser (Client).

The parameter is the same than the parameter and the parameter is the same than the parameter (parameters used in the previous versions).

You can easily enable and disable the reCAPTCHA feature using any one of the booleans or through the enabled parameter, e.g:

If you want to use the language used by the locale request as the language for the reCAPTCHA, you must activate the resolver (deactivated by default):

You can load the reCAPTCHA using the Ajax API (optional):

Additionally you can add HTTP Proxy configuration (optional):

In case you have turned off the domain name checking on reCAPTCHA's end, you'll need to check the origin of the response by enabling the option:

Congratulations! You're ready!

Basic Usage

When creating a new form class add the following line to create the field:

Symfony and PHP Reference
Package Symfony PHP
Version ~2.3 to ~2.7 5.3 to 5.6
Symfony and PHP Reference
Package Symfony PHP
Version ~2.8 5.5 to 7.1
Version ~3.0 to ~3.3 5.5 to 7.1

Note:

To denote the form type, you have to use the fully qualified class name - like in PHP 5.5+ or . Before Symfony 2.8, you could use an alias for each type like or . The old alias syntax will still work until Symfony 3.0. For more details, see the 2.8 UPGRADE Log.

You can pass extra options to reCAPTCHA with the option, e.g:

reCAPTCHA tag attributes and render parameters:

Tag attribute Render parameter Value Default Description
data-theme theme dark / light light Optional. The color theme of the widget.
data-type type audio / image image Optional. The type of CAPTCHA to serve.
data-size size compact / normal normal Optional. The size of the widget.
data-expired-callback expiredCallback Optional. The name of your callback function to be executed when the recaptcha response expires and the user needs to solve a new CAPTCHA.
defer true / false false Optional for the Ajax API.
async true / false false Optional for the Ajax API.

Support Google's Invisible reCAPTCHA! It's super easy:

Note: If you use the pre-defined callback, you would need to add class to your tag.

If you need to configure the language for the reCAPTCHA depending on your site language (ideal for multi-language sites) you can pass the language with the "language" option:

To validate the field use:

Another method would consist to pass the validation constraints as an options of your FormType. This way, your data class contains only meaningful properties. If we take the example from above, the buildForm method would look like this. Please note that if you set then the annotation will not work. You have to also set :

Cool! The form template resource is now auto registered via container extension. However, you can always implement your own custom form widget:

PHP:

Twig:

If you are not using a form, you can still implement the reCAPTCHA field using JavaScript:

PHP:

Twig:

Customization:

If you want to use a custom theme, put your chunk of code before setting the theme:

Further reading: Google Official Doc.

Tests

Execute this command to run tests:

Note: If you are running tests only and within the bundle, as first step you should run in order to install the required dependencies. Then you'll be able to run the tests!


All versions of recaptcha-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^5.3 || ^7.0
symfony/symfony Version ^2.3 || ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vihuvac/recaptcha-bundle contains the following files

Loading the files please wait ....