Download the PHP package scanii/scanii-php without Composer
On this page you can find all versions of the php package scanii/scanii-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download scanii/scanii-php
More information about scanii/scanii-php
Files in scanii/scanii-php
Package scanii-php
Short Description Zero-dependency PHP SDK for the Scanii content security API
License Apache-2.0
Homepage https://github.com/scanii/scanii-php
Informations about the package scanii-php
scanii-php
Official PHP SDK for the Scanii content processing API.
SDK Principles
- Light. Zero runtime dependencies, stdlib only.
- Up to date. Always current with the latest Scanii API.
- Integration-only. Wraps the REST API — retries, concurrency, and batching are the caller's responsibility.
The only stdlib extensions required are ext-curl and ext-json, both shipped by default with every official PHP distribution (including the Windows builds).
Install
Requires PHP 8.4 or newer.
Quickstart
ScaniiClient::create returns a thread-friendly client that you can reuse across requests; the constructor performs no I/O.
Scanning from a stream
Pass any PHP stream resource — fopen(), tmpfile(), php://temp, etc.:
API
| Method | REST | Returns |
|---|---|---|
process($path, $metadata, $callback) |
POST /files |
ScaniiProcessingResult |
processStream($stream, $filename, $contentType, $metadata, $callback) |
POST /files |
ScaniiProcessingResult |
processAsync($path, $metadata, $callback) |
POST /files/async |
ScaniiPendingResult |
processAsyncStream($stream, $filename, $contentType, $metadata, $callback) |
POST /files/async |
ScaniiPendingResult |
processFromUrl($location, $callback, $metadata) |
POST /files |
ScaniiProcessingResult (v2.2 preview) |
fetch($location, $metadata, $callback) |
POST /files/fetch |
ScaniiPendingResult |
retrieve($id) |
GET /files/{id} |
ScaniiProcessingResult |
retrieveTrace($id) |
GET /files/{id}/trace |
?ScaniiTraceResult (v2.2 preview) |
ping() |
GET /ping |
bool |
createAuthToken($timeoutSeconds) |
POST /auth/tokens |
ScaniiAuthToken |
retrieveAuthToken($id) |
GET /auth/tokens/{id} |
ScaniiAuthToken |
deleteAuthToken($id) |
DELETE /auth/tokens/{id} |
void |
retrieveAccountInfo() |
GET /account.json |
ScaniiAccountInfo |
Full API reference: https://scanii.github.io/openapi/v22/.
Regional endpoints
| Constant | Endpoint |
|---|---|
ScaniiTarget::US1 |
https://api-us1.scanii.com |
ScaniiTarget::EU1 |
https://api-eu1.scanii.com |
ScaniiTarget::EU2 |
https://api-eu2.scanii.com |
ScaniiTarget::AP1 |
https://api-ap1.scanii.com |
ScaniiTarget::AP2 |
https://api-ap2.scanii.com |
ScaniiTarget::CA1 |
https://api-ca1.scanii.com |
ScaniiTarget::AUTO |
https://api.scanii.com |
Pass any string URL for a custom or local endpoint:
Local development with scanii-cli
Run the integration tests against a local mock server — no real credentials needed:
Test credentials: key key, secret secret, endpoint http://localhost:4000.
Migration from uvasoftware/scanii-php
The PHP namespace is unchanged (Scanii\…). Other notable changes:
- The runtime no longer depends on Guzzle. Only
ext-curlandext-json(both stdlib). - The autoloader uses PSR-4 —
src/Scanii/...files moved up tosrc/.... -
Result objects use public
readonlyproperties instead of getters: -
process/processAsync/fetchnow take an explicit nullable?string $callbacklast arg (previously implicit through metadata): - Errors throw
Scanii\ScaniiException(andScaniiAuthException,ScaniiRateLimitExceptionsubclasses), not Guzzle exceptions.
The old composer coordinate uvasoftware/scanii-php is deprecated and will not receive further updates.
API documentation
See https://scanii.github.io/openapi/v22/ for the full Scanii API contract.
License
Apache 2.0 — see LICENSE.
All versions of scanii-php with dependencies
ext-curl Version *
ext-json Version *