You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(CLA), which you can do online. The CLA is necessary mainly because you own the
12
-
copyright to your changes, even after your contribution becomes part of our
13
-
codebase, so we need your permission to use and distribute your code. We also
14
-
need to be sure of various other things—for instance that you'll tell us if you
15
-
know that your code infringes on other people's patents. You don't have to sign
16
-
the CLA until after you've submitted your code for review (a link will be
17
-
automatically added to your Pull Request) and a member has approved it, but you
18
-
must do it before we can put your code into our codebase. Before you start
19
-
working on a larger contribution, you should get in touch with us first through
20
-
the issue tracker with your idea so that we can help out and possibly guide you.
21
-
Coordinating up front makes it much easier to avoid frustration later on.
3
+
Want to contribute? Great! First, read this page.
22
4
23
5
## Linting and testing
24
6
25
-
We use PHP Coding Standards Fixer to maintain coding standards and PHPUnit to
26
-
run our tests. For convenience, there are Composer scripts to run each of these:
7
+
We use PHP Coding Standards Fixer to maintain coding standards and PHPUnit to run our tests. For convenience, there are Composer scripts to run each of these:
27
8
28
9
```sh
29
10
composer run-script lint
11
+
composer run-script lint-fix
30
12
composer run-script test
31
13
```
32
14
33
-
These are run automatically by [Travis
34
-
CI](https://travis-ci.org/google/recaptcha) against your Pull Request, but it's
35
-
a good idea to run them locally before submission to avoid getting things
36
-
bounced back. That said, tests can be a little daunting so feel free to submit
37
-
your PR and ask for help.
15
+
These are run automatically by [GitHub Actions](https://github.com/phpfui/recaptcha/actions) against your Pull Request, but it's a good idea to run them locally before submission to avoid getting things bounced back. That said, tests can be a little daunting so feel free to submit your PR and ask for help.
38
16
39
17
## Code reviews
40
18
41
-
All submissions, including submissions by project members, require review.
42
-
Reviews are conducted on the Pull Requests. The reviews are there to ensure and
43
-
improve code quality, so treat them like a discussion and opportunity to learn.
44
-
Don't get disheartened if your Pull Request isn't just automatically approved.
45
-
46
-
### The small print
47
-
48
-
Contributions made by corporations are covered by a different agreement than the
49
-
one above, the Software Grant and Corporate Contributor License Agreement.
19
+
All submissions, including submissions by project members, require review. Reviews are conducted on the Pull Requests. The reviews are there to ensure and improve code quality, so treat them like a discussion and opportunity to learn. Don't get disheartened if your Pull Request isn't just automatically approved.
reCAPTCHA is a free CAPTCHA service that protects websites from spam and abuse.
9
-
This is a PHP library that wraps up the server-side verification step required
10
-
to process responses from the reCAPTCHA service. This client supports both v2
11
-
and v3.
8
+
reCAPTCHA is a free CAPTCHA service that protects websites from spam and abuse. This is a PHP library that wraps up the server-side verification step required to process responses from the reCAPTCHA service. This client supports both V2 and V3.
### Notice: This is not an officially supported version of the Google Recaptcha package
20
17
21
-
### Composer (recommended)
18
+
It appears that Google is no longer interested in supporting their PHP Open Source packages for newer versions of PHP (8.4 and up). This package is an updated version of the original Google package. It has been updated to GitHub Actions and modern PHP standards. Every effort has been made to not change logic or behavior other than conformating to modern PHP standards.
22
19
23
-
Use [Composer](https://getcomposer.org) to install this library from Packagist:
The 2.0 release allows for PHP 8.4. If you need only PHP 8.3 support and lower, you should continue to use the google/recaptcha package. For versions of PHP before 8.0, you will need to stay with the official Google 1.2 release on packagist (google/recaptcha).
55
25
56
-
The classes in the project are structured according to the
57
-
[PSR-4](https://www.php-fig.org/psr/psr-4/) standard, so you can also use your
58
-
own autoloader or require the needed files directly in your code.
26
+
The classes in the project are structured according to the [PSR-4](https://www.php-fig.org/psr/psr-4/) standard, so you can also use your own autoloader or require the needed files directly in your code.
59
27
60
28
## Usage
61
29
62
-
First obtain the appropriate keys for the type of reCAPTCHA you wish to
63
-
integrate for v2 at https://www.google.com/recaptcha/admin or v3 at
64
-
https://g.co/recaptcha/v3.
30
+
First obtain the appropriate keys for the type of reCAPTCHA you wish to integrate for v2 at https://www.google.com/recaptcha/admin or v3 at https://g.co/recaptcha/v3.
65
31
66
-
Then follow the [integration guide on the developer
67
-
site](https://developers.google.com/recaptcha/intro) to add the reCAPTCHA
68
-
functionality into your frontend.
32
+
Then follow the [integration guide on the developer site](https://developers.google.com/recaptcha/intro) to add the reCAPTCHA functionality into your frontend.
69
33
70
-
This library comes in when you need to verify the user's response. On the PHP
71
-
side you need the response from the reCAPTCHA service and secret key from your
72
-
credentials. Instantiate the `ReCaptcha` class with your secret key, specify any
73
-
additional validation rules, and then call `verify()` with the reCAPTCHA
74
-
response (usually in `$_POST['g-recaptcha-response']` or the response from
75
-
`grecaptcha.execute()` in JS which is in `$gRecaptchaResponse` in the example)
76
-
and user's IP address. For example:
34
+
This library comes in when you need to verify the user's response. On the PHP side you need the response from the reCAPTCHA service and secret key from your credentials. Instantiate the `ReCaptcha` class with your secret key, specify any additional validation rules, and then call `verify()` with the reCAPTCHA response (usually in `$_POST['g-recaptcha-response']` or the response from `grecaptcha.execute()` in JS which is in `$gRecaptchaResponse` in the example) and user's IP address. For example:
These are also hosted on Google AppEngine Flexible environment at https://recaptcha-demo.appspot.com/. This is configured by [`app.yaml`](./app.yaml) which you can also use to [deploy to your own AppEngine project](https://cloud.google.com/appengine/docs/flexible/php/download).
143
92
144
93
## Contributing
145
94
146
-
No one ever has enough engineers, so we're very happy to accept contributions
147
-
via Pull Requests. For details, see [CONTRIBUTING](CONTRIBUTING.md)
95
+
No one ever has enough engineers, so we're very happy to accept contributions via Pull Requests. Please run PHPCSFixer and PHPStan on all PRs.
0 commit comments