Download the PHP package jlorente/yii2-enhanced-captcha without Composer

On this page you can find all versions of the php package jlorente/yii2-enhanced-captcha. 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 yii2-enhanced-captcha

Yii2 Enhanced Captcha

A Yii2 extension that enhances the captcha component with the functionality of being shown only on multiple requests from the same IP

Installation

Include the package as dependency under the bower.json file.

To install, either run

or add

to the section of your composer.json file.

Usage

Loading the module

First at all you have to include the plugin as a module in your config file and bootstrap it.

You can include it by other ways. Anyway, the module id is irrelevant to use this Module, so you can establish the one you want. For more information about including modules see The Definitive Guide to Yii 2.0 - Modules.

The captcha Module uses a cache component to store the timestamp requests queue. By default it uses Apc Cache, but you can change this behavior setting the cache property in the module declaration.

For more information about supported cache storages and initialization of the component see the manual.

Other properties like the duration of the time period to check and the number of requests before the captcha will be shown can be established in the module configuration too.

By default the number of requests are 2 and the duration 120.

A controller action is provided along with the Module. This CaptchaAction can be configured in the module configuration params. See the manual to have a complete list of CaptchaAction configuration params.

Using the widget and the validator

Once the module is configured and loaded you can use the widget and validator with a Model.

Include the CaptchaValidator class as a validator for the captcha attribute.

And add the widget to the ActiveField of the captcha attribute in your view.

Now the captcha will be shown only if there are many requests from the same IP for the current model.

Further considerations

A request is counted when the CaptchaValidator is used, so if the validate method of the Model isn't called on form submit, the captcha will never be shown.

This module is an extension of the captcha functionality that comes with the Yii 2.0 framework to provide additional functionality, so if you want to see more options and configurations of the widget, validator and action please refer to the manual.

License

Copyright © 2015 José Lorente Martín [email protected]. Licensed under the MIT license. See LICENSE.txt for details.


All versions of yii2-enhanced-captcha with dependencies

PHP Build Version
Package Version
No informations.
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 jlorente/yii2-enhanced-captcha contains the following files

Loading the files please wait ....