PHPackages                             iqb/substream - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. iqb/substream

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

iqb/substream
=============

PHP stream wrapper for using only a portion of a stream.

v0.1(5mo ago)0395—0%12LGPL-3.0-or-laterPHPPHP &gt;=7.2

Since Dec 19Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/iqb/SubStream)[ Packagist](https://packagist.org/packages/iqb/substream)[ RSS](/packages/iqb-substream/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (2)

(Read-only) PHP stream wrapper for using only a portion of a stream.
====================================================================

[](#read-only-php-stream-wrapper-for-using-only-a-portion-of-a-stream)

[![Build Status](https://camo.githubusercontent.com/943999fcf186856f7280affc21d4ab8efd2f6177f2fec6ca212402ff757184c2/68747470733a2f2f7472617669732d63692e6f72672f6971622f53756253747265616d2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/iqb/SubStream)[![Code Coverage](https://camo.githubusercontent.com/b420289c03bcb3d836de35fd88abc2051cffa37a9fe6fe99785a2dfef709f44c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6971622f53756253747265616d2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/iqb/SubStream)[![Software License](https://camo.githubusercontent.com/cab72aa2f20de080d74edadd1ae7b7eb7827bbde1488184096226f38a9d65504/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4c47504c25323056332d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Issues/pull requests
--------------------

[](#issuespull-requests)

This repository is a subtree split of the [iqb/Morgue](https://github.com/iqb/Morgue) repository so it can be required as a standalone package via composer. To open an issues or pull request, please go to the [iqb/Morgue](https://github.com/iqb/Morgue) repository.

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

[](#installation)

Via [composer](https://getcomposer.org):

```
composer require iqb/substream
```

Usage
-----

[](#usage)

The stream wrapper is registered for the `iqb.substream://` protocol. To use as substream, just open a new like that:

```
use const iqb\stream\SUBSTREAM_SCHEME;

$originalStream = fopen('filename', 'r');
$offset = 25;
$length = 100;

// Provide the stream via a stream context
$context = stream_context_create([SUBSTREAM_SCHEME => ['stream' => $originalStream]]);
$substream = fopen(SUBSTREAM_SCHEME . "://$offset:$length", "r", false, $context);

// Alternatively, you can just put the stream into the URL
$substream = fopen(SUBSTREAM_SCHEME . "://$offset:$length/$originalStream", "r");

fseek($orignalStream, 50);
fseek($substream, 25);

// Will not fail
assert(fread($originalStream, 50) === fread($substream, 50));
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance73

Regular maintenance activity

Popularity16

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity19

Early-stage or recently created project

 Bus Factor1

Top contributor holds 87.5% 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

Unknown

Total

1

Last Release

150d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2b38daf7ea29726e8f479a49857e46ebe2396b354ce31dfabcf504633af43de1?d=identicon)[dennisbirkholz](/maintainers/dennisbirkholz)

---

Top Contributors

[![DennisBirkholz](https://avatars.githubusercontent.com/u/600655?v=4)](https://github.com/DennisBirkholz "DennisBirkholz (7 commits)")[![adam-vessey](https://avatars.githubusercontent.com/u/607975?v=4)](https://github.com/adam-vessey "adam-vessey (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/iqb-substream/health.svg)

```
[![Health](https://phpackages.com/badges/iqb-substream/health.svg)](https://phpackages.com/packages/iqb-substream)
```

###  Alternatives

[mnito/round-robin

Round-robin schedule generation implementation in PHP

6169.4k](/packages/mnito-round-robin)

PHPackages © 2026

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