ruiorz/captcha
最新稳定版本:v1.0.3
Composer 安装命令:
composer require ruiorz/captcha
包简介
Captcha library for PHP
README 文档
README
A simple captcha library for PHP
Installation
Require this package with composer:
composer require ruiorz/captcha
Usage
# click captcha: $captcha = new \Ruiorz\Captcha\Click\ClickCaptcha(); $result = $captcha->draw(); # or math captcha: $captcha = new \Ruiorz\Captcha\Math\MathCaptcha(); $result = $captcha->draw(); # result: print_r($result->getCaptchaData()) print_r($result->getImageByte()) print_r($result->getImageBase64())
Configuration
# click captcha: $config = new \Ruiorz\Captcha\Click\ClickCaptchaConfig(); $config->setFontPath('src/Click/fonts/msyh.ttc'); $config->setImagePath('src/Click/images/3.jpg'); $config->setVerifyLength(3); $result = (new \Ruiorz\Captcha\Click\ClickCaptcha($config))->draw(); print_r($result->getCaptchaData()); # or math captcha: $config = new \Ruiorz\Captcha\Math\MathCaptchaConfig(); $config->setFontPath('src/Math/fonts/Bitsumishi.ttf'); $result = (new \Ruiorz\Captcha\Math\MathCaptcha($config))->draw(); print_r($result->getCaptchaData());
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
统计信息
- 总下载量: 243
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-01-30