Download the PHP package shamanzpua/idempotency-engine without Composer

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

Idempotency Engine

Framework-agnostic PHP library for executing an operation exactly once per idempotency key and replaying its stored result on retries. Built for payment operations, webhook handlers, API idempotency keys and at-least-once queue consumers.

Storage backend support

Backend Status
MySQL >= 8.0 Supported
MariaDB >= 10.5 Supported
PostgreSQL >= 13 Supported
Redis >= 6.0 Supported
SQLite Not supported (locking requires SELECT ... FOR UPDATE)

Installation

For SQL backends, apply the schema once:

For Redis, install either ext-redis (use PhpRedisClient) or predis/predis (use PredisClient).

Quickstart

The first call executes the operation and stores the result. Any subsequent call with the same (scope, key) and the same payload returns the stored result without executing again.

Execution options

Exceptions you should handle

Exception Meaning
FingerprintMismatchException Same key, different payload — client bug or key reuse.
OperationInProgressException Another execution is active (THROW strategy, or WAIT timed out).
OperationStalledException The in-progress record is stale (holder likely crashed); retry after its TTL expires.
OperationFailedException Previous attempt failed and failedStrategy is THROW.
StoreException Backend I/O failure.

Record lifecycle

claim() creates a record in IN_PROGRESS. The owner transitions it to COMPLETED (with the serialized result) or FAILED (with error details). A FAILED or expired record can be reclaimed by a new execution. Completed results are replayed until the record expires.

Store notes

PDO (MySQL / MariaDB / PostgreSQL)

Redis

InMemory

InMemoryIdempotencyStore is for tests and single-process scenarios only; it is not thread-safe for async/shared-memory runtimes.

Guarantees and limitations

What the engine guarantees (per supported store):

What it does not guarantee:

Testing

Integration suites read DB_DSN/DB_USER/DB_PASSWORD (MySQL), PG_DB_DSN/PG_DB_USER/ PG_DB_PASSWORD (PostgreSQL) and REDIS_DSN. Cross-process claim contention tests live in tests/Integration/Concurrency/.

License

MIT. See LICENSE.


All versions of idempotency-engine with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
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 shamanzpua/idempotency-engine contains the following files

Loading the files please wait ...