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

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

fyre/stream
===========

A stream library.

v4.0.1(6mo ago)0382MITPHP

Since Jun 16Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/elusivecodes/FyreStream)[ Packagist](https://packagist.org/packages/fyre/stream)[ RSS](/packages/fyre-stream/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (5)Versions (22)Used By (2)

FyreStream
==========

[](#fyrestream)

**FyreStream** is a free, open-source stream library for *PHP*.

Table Of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Basic Usage](#basic-usage)
- [Methods](#methods)

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

[](#installation)

**Using Composer**

```
composer require fyre/stream

```

In PHP:

```
use Fyre\Http\Stream;
```

Basic Usage
-----------

[](#basic-usage)

- `$resource` is a resource.

```
$stream = new Stream($resource);
```

**Create From File**

- `$filePath` is a string representing the file path.
- `$mode` is a string representing the file access mode, and will default to "*r*".

```
$stream = Stream::createFromFile($filePath, $mode);
```

**Create From String**

- `$string` is a string representing the stream content.

```
$stream = Stream::createFromString($string);
```

Methods
-------

[](#methods)

**Close**

Close the resource.

```
$stream->close();
```

**Detach**

Detach the resource from the stream.

```
$stream->detach();
```

**Eof**

Determine whether the stream has ended.

```
$ended = $stream->eof();
```

**Get Contents**

Get the contents of the stream.

```
$contents = $stream->getContents();
```

**Get Metadata**

Get the stream meta data.

- `$key` is a string representing the meta data key.

```
$value = $stream->getMetadata($key);
```

If the `$key` argument is omitted, this method will return an array containing all values.

```
$data = $stream->getMetadata();
```

**Get Size**

Get the size of the stream.

```
$size = $stream->getSize();
```

**Is Readable**

Determine whether the stream is readable.

```
$isReadable = $stream->isReadable();
```

**Is Seekable**

Determine whether the stream is seekable.

```
$isSeekable = $stream->isSeekable();
```

**Is Writable**

Determine whether the stream is writable.

```
$isWritable = $stream->isWritable();
```

**Read**

Read data from the stream.

- `$length` is a number representing the number of bytes to read.

```
$data = $stream->read($length);
```

**Rewind**

Rewind the stream.

```
$stream->rewind();
```

**Seek**

Move the pointer in the stream.

- `$offset` is a number representing the offset.
- `$whence` is a number representing the offset origin, and will default to *SEEK\_SET*.

```
$stream->seek($offset, $whence);
```

**Tell**

Get the offset of the pointer.

```
$offset = $stream->tell();
```

**Write**

Write data to the stream.

- `$data` is a string representing the data to write.

```
$written = $stream->write($data);
```

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance66

Regular maintenance activity

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity57

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

Recently: every ~24 days

Total

21

Last Release

197d ago

Major Versions

v1.0 → v2.02023-07-16

v2.0.16 → v3.02025-10-22

v3.0 → v4.02025-10-24

### Community

Maintainers

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

---

Top Contributors

[![elusivecodes](https://avatars.githubusercontent.com/u/18050480?v=4)](https://github.com/elusivecodes "elusivecodes (20 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[google/cloud-core

Google Cloud PHP shared dependency, providing functionality useful to all components.

343121.4M79](/packages/google-cloud-core)[aimeos/aimeos-base

Aimeos base layer for abstracting from host environments

2.1k134.0k1](/packages/aimeos-aimeos-base)[phpgt/dom

Modern DOM API.

12412.2M18](/packages/phpgt-dom)[anthropic-ai/sdk

Anthropic PHP SDK

129134.7k5](/packages/anthropic-ai-sdk)[jaxon-php/jaxon-core

Jaxon is an open source PHP library for easily creating Ajax web applications

73142.3k25](/packages/jaxon-php-jaxon-core)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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