romeoz/rock-captcha

Captcha library

0.11.0 2015-11-11 05:11 UTC

This package is not auto-updated.

Last update: 2024-10-26 18:59:56 UTC


README

Latest Stable Version Total Downloads Build Status HHVM Status Coverage Status License

Features

  • Multi providers
  • Write code to session
  • Standalone module/component for Rock Framework

Installation

From the Command Line:

composer require romeoz/rock-captcha

In your composer.json:

{
    "require": {
        "romeoz/rock-captcha": "*"
    }
}

Quick Start

use rock\captcha\KCaptcha;

$captcha = new KCaptcha();

echo '<img src="' . $captcha->getDataUri() . '">';

$captcha->getCode(); // output: <code>

Write to session:

Required install Rock Session.

composer require romeoz/rock-session

Example:

$config = [
    'session' => new \rock\session\Session
];
$captcha = new KCaptcha($config);

echo '<img src="' . $captcha->getDataUri() . '">';

$captcha->getSession(); // output: <code>

Requirements

  • PHP 5.4+
  • For write code to session required Rock Session: composer require romeoz/rock-session
  • For using GregwarCaptcha required gregwar/captcha: composer require gregwar/captcha:1.*
  • For using SecurimageCaptcha required dapphp/securimage: composer require dapphp/securimage:3.6.*

All unbolded dependencies is optional.

License

Captcha library is open-sourced software licensed under the MIT license.