gladyshev/yii2-rucaptcha

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Yii2 rucaptcha.com captcha recognition extension.

Installs: 101

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

v1.0.1 2017-09-12 10:01 UTC

This package is auto-updated.

Last update: 2021-09-18 16:00:51 UTC


README

An extension for resolving captcha with Rucaptcha.com. It's just a wrapped gladyshev\rucaptcha-client library.

Rucaptcha API documentation is at official page.

Build Status Scrutinizer Code Quality

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist gladyshev/yii2-rucaptcha

or add

"gladyshev/yii2-rucaptcha": "*"

to the require section of your composer.json file.

Setup

Setup rucaptcha component in your configuration file:

    ...
    'components' => [
        ...
        'rucaptcha' => [
            'class' => 'gladyshev\yii\rucaptcha\Rucaptcha',
            'apiKey' => getenv('__RUCAPTCHA_KEY__'),
            'options' => [
                'verbose' => (YII_DEBUG === true)
            ]
        ],
        ...
    ],
    ...

Basic Usage

Recognize file or url:

$captchaText = Yii::$app->rucaptcha->recognizeFile('http://example.com/image.jpg');