PHPackages                             kreait/tape-recorder-subscriber - 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. kreait/tape-recorder-subscriber

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

kreait/tape-recorder-subscriber
===============================

Record HTTP interactions to replay them later with the Tape Recorder Subscriber for the Ivory HTTP Adapter

3.0.2(9y ago)2696MITPHP

Since Feb 23Pushed 9y ago2 watchersCompare

[ Source](https://github.com/kreait/tape-recorder-subscriber)[ Packagist](https://packagist.org/packages/kreait/tape-recorder-subscriber)[ Docs](https://github.com/kreait/tape-recorder-subscriber)[ RSS](/packages/kreait-tape-recorder-subscriber/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (7)Dependencies (5)Versions (8)Used By (0)

Tape Recorder Subscriber for the Ivory HTTP Adapter
===================================================

[](#tape-recorder-subscriber-for-the-ivory-http-adapter)

The Tape Recorder Subscriber for the [Ivory HTTP Adapter](https://github.com/egeloen/ivory-http-adapter/) works similarly to the [php-vcr](http://php-vcr.github.io) and also uses similar wordings :).

With it, it is possible to record the HTTP interactions, e.g. in Unit Tests, store them as Fixture files and replay them in future runs.

An example fixture (actually used for such a test) can be found here: [Example fixture](tests/Event/TapeRecorder/fixtures/testLoadExistingTape.yml).

#### Usage

[](#usage)

```
use Ivory\HttpAdapter\EventDispatcherHttpAdapter;
use Ivory\HttpAdapter\HttpAdapterFactory;
use Kreait\Ivory\HttpAdapter\Event\Subscriber\TapeRecorderSubscriber;
use Symfony\Component\EventDispatcher\EventDispatcher;

$recorder = new TapeRecorderSubscriber(__DIR__.'/fixtures');

$eventDispatcher = new EventDispatcher();
$eventDispatcher->addSubscriber($this->recorder);

$http = new EventDispatcherHttpAdapter(
    HttpAdapterFactory::guess(),
    $eventDispatcher
);

$recorder->insertTape('my_tape');
$recorder->startRecording();
$httpAdapter->get(...); // This interaction will be stored as a track.
$recorder->stopRecording;
$httpAdapter->get(...); // This interaction will not be stored.
$recorder->eject(); // Stores the tape to the file system
```

##### Recording modes

[](#recording-modes)

```
$recorder->setRecordingMode(...);
```

The following recording modes can be set when using the Tape Recorder:

ModeDescriptionRECORDING\_MODE\_ONCE(default) Performs a real request and stores it to a fixture, unless a fixture already exists.RECORDING\_MODE\_OVERWRITEAlways performs a real request and overwrites the fixture.RECORDING\_MODE\_NEVERAlways performs a real request and does not write a fixture.##### Usage example in Unit Tests

[](#usage-example-in-unit-tests)

```
namespace My\Application\Tests;

use Ivory\HttpAdapter\EventDispatcherHttpAdapter;
use Ivory\HttpAdapter\HttpAdapterFactory;
use Kreait\Ivory\HttpAdapter\Event\Subscriber\TapeRecorderSubscriber;
use Symfony\Component\EventDispatcher\EventDispatcher;

class MyTest extends extends \PHPUnit_Framework_TestCase
{
    /** @var \Ivory\HttpAdapter\HttpAdapterInterface **/
    protected $http;

    /** @var TapeRecorderSubscriber */
    protected $recorder;

    protected function setUp()
    {
        $this->recorder = new TapeRecorderSubscriber(__DIR__.'/fixtures');

        $http = HttpAdapterFactory::guess();

        $eventDispatcher = new EventDispatcher();
        $eventDispatcher->addSubscriber($this->recorder);

        $this->http = new EventDispatcherHttpAdapter(
            $http, $eventDispatcher
        );
    }

    protected function tearDown()
    {
        $this->recorder->eject();
    }

    protected function testRequest()
    {
        // This will result in the file 'fixtures/testRequest.yml'
        $this->recorder->insertTape(__FUNCTION__);
        $this->recorder->startRecording();
        $this->http->get(...);
    }
}
```

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity68

Established project with proven stability

 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 ~85 days

Recently: every ~115 days

Total

7

Last Release

3632d ago

Major Versions

1.0 → 2.02015-04-10

2.0.2 → 3.02015-08-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/8685cf532053a084f1eade7b7da00a512c02676e65f1f1bdec73d4978030a47d?d=identicon)[jeromegamez](/maintainers/jeromegamez)

---

Top Contributors

[![jeromegamez](https://avatars.githubusercontent.com/u/67554?v=4)](https://github.com/jeromegamez "jeromegamez (22 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kreait-tape-recorder-subscriber/health.svg)

```
[![Health](https://phpackages.com/badges/kreait-tape-recorder-subscriber/health.svg)](https://phpackages.com/packages/kreait-tape-recorder-subscriber)
```

###  Alternatives

[symfony/http-kernel

Provides a structured process for converting a Request into a Response

8.1k853.6M8.3k](/packages/symfony-http-kernel)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19564.8M1.6k](/packages/drupal-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6941.5M396](/packages/drupal-core-recommended)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M519](/packages/shopware-core)[eliashaeussler/cache-warmup

Composer package to warm up website caches, based on a given XML sitemap

75419.2k9](/packages/eliashaeussler-cache-warmup)

PHPackages © 2026

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