Download the PHP package labcat/recaptcha without Composer

On this page you can find all versions of the php package labcat/recaptcha. 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

reCAPTCHA FormField Module

Build Status

Introduction

Provides a FormField which allows form to validate for non-bot submissions using Google's reCAPTCHA v2 service.

In order to use Google's new Invisible reCAPTCHA service, please use the undefinedoffset/silverstripe-nocaptcha module. This module is not intended to be used with reCAPTCHA v3 (see rationale)

Requirements

Installation

composer require labcat/recaptcha

This should go in your mysite/_config/recaptcha.yml. You can get an free API key at https://www.google.com/recaptcha

If using on a site requiring a proxy server for outgoing traffic then you can set these additional options in your mysite/_config/recaptcha.yml by adding.

To use the noscript fallback method, add the key noscript_enabled: true to your yml.

To change the language, add it to an array of options to your yml

See https://developers.google.com/recaptcha/docs/display#render_param for all available parameters

Usage

As a Standalone Field

If you want to use reCAPTCHA field by itself, you can simply just include it as a field in your form.

$recaptchaField = new RecaptchaField('MyCaptcha');
$recaptchaField->options = array('theme' => 'light'); // optional

See reCAPTCHA docs for more configuration options.

Integration with spamprotection module

This requires the spamprotection module to be installed, see its documentation for details. You can use this field to protect any built informs on your website, including user comments in the [[:modules:blog]] module.

Configuration example in mysite/_config/spamprotection.yml

---
name: spamprotection
---
SilverStripe\SpamProtection\Extension\FormSpamProtectionExtension:
  default_spam_protector: SilverStripe\Recaptcha\RecaptchaProtector

Then once you have setup this config you will need to include the spam protector field as per the instructions on the spamprotection page.

Known issues:

Problems with page doctype XHTML

reCAPTCHA current does not work if the page doctype is XHTML. The API returns Javascript which uses "document.write", which is not supported in XHTML. A work-around is to always use the no-script version of the module (modify the relevant lines in RecaptchaField.php), or to switch your webpage's doctype to HTML 4. See: http://www.w3schools.com/tags/tag_DOCTYPE.asp


All versions of recaptcha with dependencies

PHP Build Version
Package Version
Requires silverstripe/spamprotection Version ~3.0
silverstripe/framework Version ^4.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 labcat/recaptcha contains the following files

Loading the files please wait ....