PHPackages                             turbine-kreuzberg/spryker-http-recorder - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. turbine-kreuzberg/spryker-http-recorder

ActiveLibrary[HTTP &amp; Networking](/categories/http)

turbine-kreuzberg/spryker-http-recorder
=======================================

HTTP recorder for Spryker based on php-vcr (https://php-vcr.github.io/)

0.2.5(3y ago)023.1kMITPHPPHP &gt;=8.0

Since May 17Pushed 2y ago6 watchersCompare

[ Source](https://github.com/turbine-kreuzberg/spryker-http-recorder)[ Packagist](https://packagist.org/packages/turbine-kreuzberg/spryker-http-recorder)[ RSS](/packages/turbine-kreuzberg-spryker-http-recorder/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (8)Versions (4)Used By (0)

Spryker Http Recorder
=====================

[](#spryker-http-recorder)

This package provides an integration for [php-vcr](https://php-vcr.github.io/) in Spryker.
It is a wrapper around [php-vcr/php-vcr](https://github.com/php-vcr/php-vcr).

- [Installation](#installation)
- [Usage](#usage)
    - [Examples](#examples)
        - [Glue integration](#glue-integration)
        - [Integration in HTTP request method](#integration-in-http-request-method)
- [Configuration](#configuration)
- [Credits](#credits)
- [License](#license)

Installation
------------

[](#installation)

- Install the package via composer (usually as a dev dependency with the flag `--dev`)

```
composer require [--dev] turbine-kreuzberg/spryker-http-recorder

```

Usage
-----

[](#usage)

You need to `HttpRecorderService::initialize();` as early as possible after class autoloading in your callstack (usually in an `index.php`), because php-vcr intercepts with all HTTP requests.

### Examples

[](#examples)

#### Glue integration

[](#glue-integration)

Add `HttpRecorderService::initialize();` in `public/Glue/index.php` right after `Environment::initialize();`

```
...
require_once APPLICATION_ROOT_DIR . '/vendor/autoload.php';

Environment::initialize();

HttpRecorderService::initialize();
...
```

#### Integration in HTTP request method

[](#integration-in-http-request-method)

In your class that makes HTTP requests you want to record, you need to set a file to use for recording (and replay).

```
    public function makeHttpRequest(...)
    {
        // just define the basic filename, the file extension will be added
        // based on the configured storage type ('.yaml', '.json')
        $this->httpRecorderService->setRecordingFile('your-recording-file');

        try {
            $this->client->call(...);
        } finally {
            // stop recording (=turn off VCR client) after the request,
            // no matter if it succeeds or fails
            register_shutdown_function(function () {
                $this->httpRecorderService->stopRecording();
            });
        }
    }
```

Configuration
-------------

[](#configuration)

For an easy start, copy the following snippet to your `config_local.php`

```
use TurbineKreuzberg\Shared\HttpRecorder\HttpRecorderConstants;

/**
 * MODES:
 * To enable the usage of http recorder, set the mode.
 * - To just record requests and responses, use mode HttpRecorderConstants::MODE_RECORD
     $config[HttpRecorderConstants::MODE] = HttpRecorderConstants::MODE_RECORD;
 * - To just replay recorded requests and responses, use mode HttpRecorderConstants::MODE_REPLAY
 *   If no recording exists, the first request (and response) will be recorded
     $config[HttpRecorderConstants::MODE] = HttpRecorderConstants::MODE_REPLAY;
 *
 * LIBRARY HOOKS:
 * By default all library hooks are enabled.
 * But you can also specifically enable only some hooks, e.g. 'soap':
   $config[HttpRecorderConstants::VCR_LIBRARY_HOOKS] = [
     'soap',
   ];
 * For more details, see https://php-vcr.github.io/documentation/configuration/#library-hooks
 *
 * RECORDING PATH:
 * By default, recordings are stored and read from /tmp
 * To use recordings from a different folder, set HttpRecorderConstants::VCR_CASSETTE_PATH to that path.
   $config[HttpRecorderConstants::VCR_CASSETTE_PATH] = APPLICATION_ROOT_DIR . '/your/custom/path/for/vcr/recordings';
 *
 * STORAGE TYPE:
 * By default, recordings are stored in JSON format ('json').
 * To use yaml format, set storage type to 'yaml':
   $config[HttpRecorderConstants::VCR_STORAGE_TYPE] = 'yaml';
 * For more details, see https://php-vcr.github.io/documentation/configuration/#storage
 *
 * REQUEST MATCHERS:
 * Requests are matched by different criteria. By default, these request matchers are used:
   $config[HttpRecorderConstants::VCR_REQUEST_MATCHERS] =             [
     'method',
     'url',
     'host',
   ];
 * You can create your own request matchers and use them as callbacks
 * For more details, see https://php-vcr.github.io/documentation/configuration/#request-matching
 *
 * ALLOW/DENY LISTS FOR PATHS TO INTERCEPT:
 * By default, there is an allow list with 'vendor/guzzle':
   $config[HttpRecorderConstants::VCR_ALLOW_LIST] = [
     'vendor/guzzle',
   ];
 * The deny list is empty by default:
   $config[HttpRecorderConstants::VCR_DENY_LIST] = [];
 * For more details, see https://php-vcr.github.io/documentation/configuration/#white--and-blacklisting-paths
*/
```

Credits
-------

[](#credits)

- [All Contributors](../../graphs/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~12 days

Total

2

Last Release

1444d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fe66c182ebe0cea533fa24041957f2800e6aa928060568b3ae37a7e92ebb5d38?d=identicon)[bazoo0815](/maintainers/bazoo0815)

---

Top Contributors

[![berndalter-txb](https://avatars.githubusercontent.com/u/4046983?v=4)](https://github.com/berndalter-txb "berndalter-txb (4 commits)")

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/turbine-kreuzberg-spryker-http-recorder/health.svg)

```
[![Health](https://phpackages.com/badges/turbine-kreuzberg-spryker-http-recorder/health.svg)](https://phpackages.com/packages/turbine-kreuzberg-spryker-http-recorder)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)[php-http/curl-client

PSR-18 and HTTPlug Async client with cURL

48247.0M384](/packages/php-http-curl-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
