PHPackages                             willwashburn/stream - 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. willwashburn/stream

ActiveLibrary

willwashburn/stream
===================

model a sequence of data elements made available over time

v1.0.0(10y ago)4994.0k↓16.9%2MITPHPPHP &gt;=5.4.0

Since Mar 15Pushed 10y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (2)Versions (2)Used By (2)

Stream 🚣 [![Travis](https://camo.githubusercontent.com/1e27b2fff8d7a071aba2b34790f1307fddbca4b0ae43c67fcf965c7f82f3422e/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f77696c6c776173686275726e2f73747265616d2e737667)](https://travis-ci.org/willwashburn/stream) [![Packagist](https://camo.githubusercontent.com/9a0711dabc8db6cc8a24b72d847613b117998ab8fd44a33c49a36fcaab99a44f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f77696c6c776173686275726e2f73747265616d2e737667)](https://packagist.org/packages/willwashburn/stream) [![Packagist](https://camo.githubusercontent.com/75fe5ef27c633e8edf4a7d6d7d0da20ec28802a5890d075de7d8f38e06d28a92/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f77696c6c776173686275726e2f73747265616d2e737667)](https://packagist.org/packages/willwashburn/stream) [![MIT License](https://camo.githubusercontent.com/e4203d980cdbf1e0fb6359e925cddb1882063c0172f11d43a2f8d4467f2d847b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f77696c6c776173686275726e2f73747265616d2e7376673f7374796c653d666c61742d737175617265)](https://github.com/willwashburn/stream/blob/master/LICENSE)
======================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#stream-rowboat----)

> model a sequence of data elements made available over time

Usage
-----

[](#usage)

Write and read (or peek) from a string of characters.

```
$stream = new \WillWashburn\Stream\Stream();
$stream->write('foo');

$stream->read(3); //foo

$stream->write('bar');
$stream->write('bang');

$stream->read(4); // barb
$stream->peek(3); // ang
$stream->read(3); // ang
```

I mostly use this when buffering responses from curl requests.

```
$stream = new WillWashburn\Stream\Stream;

curl_setopt($ch, CURLOPT_WRITEFUNCTION, function ($ch, $str) use (& $stream, $url) {

   $stream->write($str);

   try {
       // do something with the stream
       $characters = $stream->read(100);

       // tell curl to stop the transfer when we find what we're looking for
       if(strpos($characters,'string im looking for') !==false) {
           return -1;
       }
   }
   catch (StreamBufferTooSmallException $e) {
       // The buffer ended, so keep getting more
       return strlen($str);
   }

   //  We return -1 to abort the transfer when we have enough buffered
   return -1;
});
```

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

[](#installation)

Use composer

`composer require willwashburn/stream`

Alternatively, add `"willwashburn/stream": "~1.0.0"` to your composer.json

Change Log
----------

[](#change-log)

- v1.0.0 - Basic stream model

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community11

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

3716d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/957608?v=4)[Will Washburn](/maintainers/willwashburn)[@willwashburn](https://github.com/willwashburn)

---

Top Contributors

[![willwashburn](https://avatars.githubusercontent.com/u/957608?v=4)](https://github.com/willwashburn "willwashburn (7 commits)")

---

Tags

streamreadpeekstreamable

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/willwashburn-stream/health.svg)

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

###  Alternatives

[openspout/openspout

PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way

1.2k57.6M131](/packages/openspout-openspout)[adlawson/vfs

Virtual file system

300433.0k21](/packages/adlawson-vfs)[dcat/easy-excel

使用简单实用的语义化接口快速读写Excel文件

155373.4k24](/packages/dcat-easy-excel)

PHPackages © 2026

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