Download the PHP package cleatsquad/php-http-replay without Composer

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

PHP HTTP Replay

Latest Version

Deterministic HTTP request recording and replay for PHP built on PSR-7 and PSR-18.

A test that calls a real API is slow, costs money, and fails for reasons that have nothing to do with your code. Record the exchange once, replay it forever after: the same request returns the same response, offline, in milliseconds. When the request no longer matches what was recorded, you get told exactly which field differed — not just that something did.

Architecture

php-http-replay separates the replay pipeline into four independent layers:

Installation

Requires PHP 8.2 or later. The core depends on PSR interfaces only (psr/http-message, psr/http-client, psr/http-factory); Guzzle and Symfony YAML are optional and used only by the integration and import layers.

See UPGRADE.md for upgrade notes and compatibility guides between major/minor versions.

Usage

Execution Modes

Matching Modes & Strategies

By default, requests are matched sequentially (ExecutionMatchingMode::Sequential). You can configure non-sequential, out-of-order matching via ExecutionMatchingMode::Unordered (OPT-IN):

Performance & Trade-offs: In Sequential mode, matching is $O(1)$ per request. In Unordered mode, matching is up to $O(N)$ per request where $N$ is the number of exchanges in the cassette. For large cassettes ($N > 1000$), Sequential mode is strongly recommended.

Matching

DefaultRequestMatcher compares method, URI, headers and body. JSON bodies are compared semantically: object key order is ignored, array element order is significant, and scalar types are compared strictly, so 1 does not match "1". Query parameters are compared as a set.

When nothing matches, RequestMismatchException (or UnorderedMismatchException in unordered mode) names the failing path, for instance body.messages.0.content, along with the expected and actual values.

Diagnostics & CLI Output

Difference, MatchResult, and RequestMismatchException offer multi-line CLI diagnostic output:

Output:

Sanitization & JSON Path Redaction

DefaultSanitizer redacts secrets in headers, URI query parameters, recursively in JSON bodies by key name, and by explicit JSON paths/pointers (e.g., $.user.profile.token or payment.card.number):

Storage Backends & Checksum Integrity

Replay Audit Trail & Inspection

HttpReplayEngine::stats() returns a ReplayStats snapshot to inspect cassette consumption:

unusedIndices lists the exchanges the cassette already held and that were never replayed, which is what a stale cassette looks like. An exchange recorded during the session by Record or RecordOnce is never counted as unused.

Cassette Naming Strategies

Use CassetteNamingStrategyInterface for dynamic cassette resolution:

Importing php-vcr cassettes

Optional Community Integrations

php-http-replay is fully autonomous and zero-dependency. Community integration packages can be installed separately:

Limitations

Public API

Everything under src/ that is public follows Semantic Versioning, except src/Internal/, which is excluded and may change in any release.

Contributing

See UPGRADE.md. Bug reports and pull requests are welcome.

License

MIT. Copyright (c) 2026 Mohamed El Mrabet. See LICENSE.


All versions of php-http-replay with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.0 || ^2.0
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 cleatsquad/php-http-replay contains the following files

Loading the files please wait ...