-
Notifications
You must be signed in to change notification settings - Fork 767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow manual install #34
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA) at https://cla.developers.google.com/. If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check the information on your CLA or see this help article on setting the email on your git commits. Once you've done that, please reply here to let us know. If you signed the CLA as a corporation, please let us know the company's name. |
CLA is signed. |
CLAs look good, thanks! |
Thanks @orlitzky I'll take a look at this over the weekend. |
Thanks, I'm not married to this particular implementation, but I didn't want to show up empty-handed =) If you'd prefer to do it some other way I can always rewrite and send another PR. |
*/ | ||
|
||
spl_autoload_register(function ($class) { | ||
/* All of the classes have names like "ReCaptcha\Foo", so we need |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restrict this to only autoload the ReCaptcha
namespace. So, just early out of the function for anything else.
Thanks again, @orlitzky and sorry for taking a while to jump back on this. I've made some comments. If you're happy to do the changes that would be cool, otherwise I'll drop an implementation in sometime in the next few days. |
Thank you for merging this! I should be able to package the next release for inclusion in Gentoo. |
Relying on Composer for the installation is causing us one big problem: the library can't be installed via our distribution's package manager. If you don't use Composer for the install, then Recaptcha doesn't work out-of-the-box: none of the class includes are in the files that use them. (This also crashes the test suite.)
The least-intrusive way to fix this (I could also have re-added the
require
statements?) was to supply a simple autoloader along with the library. This allows users to include thesrc/autoload.php
even without Composer present on the target machine. Distributions can packagesrc/autoload.php
normally since it doesn't have to be generated on-the-fly. Finally, the test suite can bootstrap using it -- so now the test suite will run from a clean checkout.