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

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

pbergman/stream-wrapper
=======================

A stream wrapper for registering and using resources as url argument

2.0.0(5y ago)21.2k↓100%MITPHPPHP &gt;=7

Since Aug 8Pushed 5y ago1 watchersCompare

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

READMEChangelog (2)DependenciesVersions (3)Used By (0)

Stream Wrapper
--------------

[](#stream-wrapper)

This little library was build to use an resource with [XMLWriter](http://php.net/manual/en/book.xmlwriter.php) and [XMLReader](http://php.net/manual/en/book.xmlreader.php) but could be used with everything that support an "URL like" path name as argument.

Example
-------

[](#example)

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

    use PBergman\Stream\StreamWrapper;

    // createtmp buffer
    $fd = fopen('php://temp', 'w');

    // register buffer and wrapper protocol
    StreamWrapper::register($fd, 'foo');

    // create xml
    $writer = new \XMLWriter();
    $writer->openUri('wrapper://foo');
    $writer->setIndent(true);
    $writer->startElement('records');
    $writer->startElement('record');
    $writer->startElement('title');
    $writer->text('Some title...');
    $writer->endElement();
    $writer->endElement();
    $writer->endElement();
    $writer->flush();

    rewind($fd);
    var_dump(stream_get_contents($fd));

    // should output something like:
    // string(73) "
    //
    //   Some title...
    //
    //
    // "

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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 ~776 days

Total

2

Last Release

2054d ago

Major Versions

1.0.0 → 2.0.02020-09-23

PHP version history (2 changes)1.0.0PHP &gt;=5.6.0

2.0.0PHP &gt;=7

### Community

Maintainers

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

---

Top Contributors

[![activin-user](https://avatars.githubusercontent.com/u/69504579?v=4)](https://github.com/activin-user "activin-user (1 commits)")[![pbergman](https://avatars.githubusercontent.com/u/1193198?v=4)](https://github.com/pbergman "pbergman (1 commits)")

---

Tags

streamwrapperstream-wrapper

### Embed Badge

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

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

###  Alternatives

[simplesoftwareio/simple-qrcode

Simple QrCode is a QR code generator made for Laravel.

2.9k27.6M91](/packages/simplesoftwareio-simple-qrcode)[react/stream

Event-driven readable and writable streams for non-blocking I/O in ReactPHP

688126.8M194](/packages/react-stream)[artisaninweb/laravel-soap

A SoapClient wrapper integration for Laravel

6314.5M12](/packages/artisaninweb-laravel-soap)[trafficcophp/bytebuffer

Node.js inspired byte stream buffer for PHP.

33437.2k17](/packages/trafficcophp-bytebuffer)[mhor/php-mediainfo

PHP wrapper around the mediainfo command

120574.8k7](/packages/mhor-php-mediainfo)[zoon/rialto

Manage Node resources from PHP

12199.4k3](/packages/zoon-rialto)

PHPackages © 2026

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