Download the PHP package captchala/captchala-php without Composer

On this page you can find all versions of the php package captchala/captchala-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 captchala-php

Captchala PHP SDK

Server-side SDK for validating Captcha tokens.

English | 简体中文

Installation

Quick Start

API Reference

Client::__construct(string $appKey, string $appSecret, int $timeout = 5)

Create a client instance.

Client::validate(string $token, bool $keepToken = false, ?string $clientIp = null): ValidateResult

Validate a token.

ValidateResult Methods

Method Return Type Description
isValid() bool Whether validation passed
isOffline() bool Whether this was offline verification
isClientOnly() bool Whether this is a client-only token
getError() ?string Get error message
getWarning() ?string Get warning message
getChallengeId() ?string Get challenge ID
getAction() ?string Get business action
getUid() ?string User ID bound via bind_uid — verify the pass_token belongs to the expected user
getUserIp() ?string End-user IP recorded at solve time (informational).
getCaptchaArgs() array Solve-context echo (platform, user_ip, referer, pkg, solved_at, risk_score). All informational.
toArray() array Convert to array

Solve-context echo (captcha_args)

getCaptchaArgs() returns what the platform recorded at solve time — use it for logging / your own risk scoring, never as a pass/fail gate:

Verifying bind_uid

If you issued the server_token with bind_uid = 'user_42', compare the result against the expected user:

Client::issueServerToken(string $action, ?string $bindingIp = null, ?int $ttl = null, ?int $maxUses = null, ?string $bindUid = null): IssueResult

Mint a one-time sct_ server token. Hand the returned token to the browser SDK via the serverToken prop — single-use, action-scoped, optionally IP/UID-bound.

IssueResult Method Return Description
isOk() bool Issuance succeeded
getToken() ?string The sct_<hex> server token
getExpiresIn() ?int TTL in seconds
getIssuedAt() ?int Unix timestamp (seconds)
getError() ?string Error code
getMessage() ?string Human-readable error message

Client::moderationCheck(array $input, ?string $userId = null): ModerationResult

Multi-modal content moderation. $input is a list of {type, ...} items in OpenAI-compatible format — text and image_url can be mixed in one call.

Client::moderationText(string $text, ?string $userId = null): ModerationResult

Convenience wrapper for plain-text moderation.

ModerationResult Method Return Description
isOk() bool Request succeeded (regardless of flagged)
isFlagged() bool Upstream model verdict
hasCategory(...$names) bool True if any named category tripped
getCategories() array Map of category → bool; categories vary by upstream model
getContentType() ?string 'text' / 'image' / 'mixed'
getRaw() array Full upstream payload for advanced inspection
getError() ?string Error code
getMessage() ?string Human-readable error message

Token Types

Prefix Source Security Level
pt_ Main API High
offline_ Backup Service Medium
client_ Client-only Low (cannot verify server-side)

Complete Example

Laravel Integration

Testing

License

MIT


CMS plugin helpers (Captchala\Cms)

Used by CaptchaLa's CMS plugins (WordPress, Joomla, Drupal, Magento, …) — most integrators don't need these directly.

Action constants

Widget renderer

Error standardizer


All versions of captchala-php with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
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 captchala/captchala-php contains the following files

Loading the files please wait ...