nayzawoo/mmrcaptcha

This package is abandoned and no longer maintained. No replacement package was suggested.

Myanmar Captcha

1.0.21 2017-01-27 05:52 UTC

This package is not auto-updated.

Last update: 2022-02-01 13:04:58 UTC


README

Build Status

PHP Math CAPTCHA with Myanmar Font

Example Example Example Example Example Example Example Example

Requirements

  • PHP >= 5.4
  • GD Library (>=2.0) [or] Imagick PHP extension (>=6.5.7)

Installation

composer require nayzawoo/mmrcaptcha

Usage

Create Captcha Image

<?php

require 'vendor/autoload.php';

use MyanmarCaptcha\Captcha;
use MyanmarCaptcha\CaptchaString;

$captcha = new Captcha(new CaptchaString);
$captcha = $captcha
    ->width(180)
    ->height(50)
    ->fontSize(40)
    ->fontPath(__DIR__.'/src/assets/mon3.ttf')
    ->textColor("#000000")
    ->backgroundColor("#FFFFFF")
    ->backgroundImage("./src/assets/bg1.png")
    ->horizontalLines(5)
    ->disableDistortion()
    ->dots(2000)
    ->verticalLines(20)
    ->invert()
    ->build();

$imageQuality = 100;
echo $captcha->response('jpg', $imageQuality);

License

This library is released under the MIT License. See License file for more details.