rdx/text-captcha 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

rdx/text-captcha

Composer 安装命令:

composer require rdx/text-captcha

包简介

README 文档

README

Create a captcha maker

Without any config:

$maker = CaptchaMaker::createLocal('en'); // or 'nl'

With some custimization:

$maker = new CaptchaMaker();
$maker->add(new ArithmeticCaptcha(new ArithmeticTranslatorLocal(__DIR__ . "/lang/arithmetic-$lang.php")), 10);
$maker->add(new WordListCaptcha(new WordListTranslatorLocal(__DIR__ . "/lang/wordlist-$lang.php")), 20);

10 and 20 for a 10:20 chance of an ArithmeticCaptcha. You can decide which captcha's to use more. Selection is random, but you decice the relative chance.

Create a random captcha

Of a random type:

$captcha = $maker->make();

Or create the type explicitly, and then the captcha:

$type = $maker->random();
$captcha = $type->make();

Translations

nl and en (US) are included. You can add your own language files and select them easily, by manually adding captcha types with translators.

Or you can get translations from anywhere else, by implementing the correct translators (every captcha type has one), and passing it to the captcha type.

Examples

  • In the list list apple mango arm banana pink horse what's the third fruit?
    • banana
  • What's the first color in monkey head mango arm blue cow?
    • blue
  • Of list head banana cow kiwi yellow monkey what's the first body part?
    • head
  • What is eleven plus zero?
    • 11
    • eleven
  • three plus eleven = ?
    • 14
    • fourteen
  • Calculate twelve minus seven.
    • 5
    • five

See demo.php for making captchas and lang/* for translations.

统计信息

  • 总下载量: 20
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-01-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固