vividcortex / recaptcha-validator
v0.1.1
2016-02-05 18:51 UTC
Requires
- php: >=5.4
- guzzlehttp/guzzle: ~5.2
Requires (Dev)
- phpspec/phpspec: ~2.1
Suggests
- google/recaptcha: This package has been deprecated in favor of Google's own recaptcha validator.
This package is not auto-updated.
Last update: 2020-12-15 17:48:44 UTC
README
弃用通知
此包已被弃用,转而使用Google自家的reCaptcha验证器。
用PHP编写的Google reCaptcha响应的简单验证器。
安装
使用composer添加项目依赖。
composer require vividcortex/recaptcha-validator
工作原理
首先,您需要使用Google提供的密钥实例化一个新的验证器。
use VividCortex\RecaptchaValidator\Validator; // ... $validator = new Validator($secret);
然后,您可以继续验证响应。需要响应和客户端IP。
// Returns TRUE or FALSE $result = $validator->validate($response, $clientIp);