enunez/grecaptcha-validator
Composer 安装命令:
composer require enunez/grecaptcha-validator
包简介
Google recaptcha validator
README 文档
README
The Google reCAPTCHA Verification PHP library is a tool for software developers to verify the response of Google reCAPTCHA v2 or v3 from within their PHP applications. This library simplifies the process of verifying the user's response to a reCAPTCHA challenge and provides an easy-to-use interface for integrating the verification process into your PHP code.
With this library, you can easily configure and set up reCAPTCHA verification for your PHP application, without the need for complicated coding. You can easily specify your reCAPTCHA API key, secret key, and other necessary configuration parameters, and then call the library functions to verify the response received from the reCAPTCHA challenge.
This library supports both the v2 and v3 versions of Google reCAPTCHA, so you can use it for a wide range of applications. It provides error handling and reporting functionality, allowing you to easily detect and handle any errors that may occur during the verification process.
The Google reCAPTCHA Verification PHP library is open-source and available for free on GitHub. This library helps you easily integrate the power of Google reCAPTCHA into your PHP application, ensuring that your users are protected from spam and abuse.
Quick start
Installation
Installation is handle via Composer:
$ composer require enunez/grecaptcha-validator
or add it manually to you composer.json file
{
"require": {
"enunez/grecaptcha-validator": "^1.0.0"
}
}
Usage
This is a quick example of how to use the library:
$captcha = Builder::getInstance(YOUR_SHARED_KEY, USER_RESPONSE_TOKEN)->build(); $captcha->isValid();
To include the remote IP address:
$captcha = Builder::getInstance(YOUR_SHARED_KEY, USER_RESPONSE_TOKEN)->remoteIp(REMOTE_IP)->build(); $captcha->isValid();
If verification fails you can access all error codes by using:
if (!$captcha->isValid()) { foreach ($errorCode as $captcha->errorCodes()) { // processing the error code } }
For more details on the supported error codes please check: https://developers.google.com/recaptcha/docs/verify#error_code_reference
License
This library is open-sourced software licensed under the MIT license.
enunez/grecaptcha-validator 适用场景与选型建议
enunez/grecaptcha-validator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 04 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 enunez/grecaptcha-validator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 enunez/grecaptcha-validator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-04-01