Download the PHP package zhylon/captcha-php without Composer

On this page you can find all versions of the php package zhylon/captcha-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package captcha-php

captcha-php

Latest Stable Version Tests License

PHP client for server-side verification of Zhylon Captcha tokens.

Installation

Usage

CaptchaClient

Parameter Type Default Description
secretKey string — Your Zhylon Captcha secret key
verifyUrl string https://captcha.zhylon.net/captcha/siteverify Verification endpoint
timeout int 5 Request timeout in seconds

CaptchaResult

Property Type Description
success bool Whether verification succeeded
reason ?string invalid_token, config_error, or network_error on failure
message ?string Human-readable explanation

Use $result->isTechnicalFailure() to distinguish infrastructure problems (config_error, network_error) from a genuinely invalid token.

Self-hosted challenge/verify proxy

If your widget's JS talks to your own domain instead of captcha.zhylon.net directly, use CaptchaProxy to forward the captcha/challenge and captcha/verify calls to the real Zhylon Captcha host. It reuses the host already configured on your CaptchaClient, so no extra configuration is needed, and it never lets an upstream failure (e.g. a misconfigured endpoint) turn into an uncaught exception — you always get back a status code and a JSON body to relay as-is.

Note: CaptchaProxy::verify() forwards the proof-of-work captcha/verify call (used to obtain a verification_token). It is unrelated to CaptchaClient::verify(), which is the server-side siteverify check performed with your secret key.

CaptchaProxy

Parameter Type Default Description
baseUrl string https://captcha.zhylon.net Host the challenge/verify calls are forwarded to
timeout int 5 Request timeout in seconds

Use CaptchaProxy::forClient($client) to derive baseUrl automatically from an existing CaptchaClient's verifyUrl.

On an upstream failure (unreachable host, non-2xx response, or invalid JSON), challenge()/verify() return a CaptchaProxyResponse with status = 502 and a body of ['error' => '...'] instead of throwing.

Testing

License

The MIT License (MIT). See LICENSE for more information.


All versions of captcha-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-curl Version *
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package zhylon/captcha-php contains the following files

Loading the files please wait ...