PHPackages                             konstantin-kuklin/stream-library - 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. konstantin-kuklin/stream-library

ActivePhp-library[Utility &amp; Helpers](/categories/utility)

konstantin-kuklin/stream-library
================================

Wrapper for stream functions

1.0.1(8y ago)389612MITPHPPHP &gt;=5.3.2

Since Aug 8Pushed 8y ago1 watchersCompare

[ Source](https://github.com/KonstantinKuklin/StreamLibrary)[ Packagist](https://packagist.org/packages/konstantin-kuklin/stream-library)[ Docs](https://github.com/KonstantinKuklin/StreamLibrary)[ RSS](/packages/konstantin-kuklin-stream-library/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (7)Used By (2)

[![Build Status](https://camo.githubusercontent.com/4ccccbc1ddfa8731e89ca79fd53930790914c409ce9824e16d8af2800dcb4652/68747470733a2f2f7472617669732d63692e6f72672f4b6f6e7374616e74696e4b756b6c696e2f53747265616d4c6962726172792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/KonstantinKuklin/StreamLibrary)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/618562ab1ea794a798ff3e5c14ad1fdffadaff1695d0843d418bdd6f921c1f56/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4b6f6e7374616e74696e4b756b6c696e2f53747265616d4c6962726172792f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/KonstantinKuklin/StreamLibrary/?branch=master)[![Scrutinizer Test Coverage](https://camo.githubusercontent.com/ef6e26f71df34e6ebd577113ced43ce5e4b506e7b5fcd3b64617f0c417934280/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4b6f6e7374616e74696e4b756b6c696e2f53747265616d4c6962726172792f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/KonstantinKuklin/StreamLibrary/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/965cafc13da7ed52900095c14eb5c342e3fb0213ac5e24c591d3b41e57f9f9c8/68747470733a2f2f706f7365722e707567782e6f72672f6b6f6e7374616e74696e2d6b756b6c696e2f73747265616d2d6c6962726172792f762f737461626c652e706e67)](https://packagist.org/packages/konstantin-kuklin/stream-library)[![Total Downloads](https://camo.githubusercontent.com/a8c080dee15ba0c6959720d353be149b47c6693d56b4afeced70c0b3a58daa49/68747470733a2f2f706f7365722e707567782e6f72672f6b6f6e7374616e74696e2d6b756b6c696e2f73747265616d2d6c6962726172792f646f776e6c6f6164732e706e67)](https://packagist.org/packages/konstantin-kuklin/stream-library)

README
======

[](#readme)

What is StreamLibrary?
----------------------

[](#what-is-streamlibrary)

StreamLibrary is a PHP wrapper via stream functions. It allows to work with streams with more comfortable environment.

Requirements
------------

[](#requirements)

StreamLibrary is only supported on PHP 5 and up.

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

[](#installation)

The best way to install StreamLibrary is with composer:

```
composer.phar require konstantin-kuklin/stream-library:dev-master

```

Documentation
-------------

[](#documentation)

First step to work is a creating object of Stream:

```
$stream = new \Stream\Stream($path, $protocol, $port, $driver);
```

**path** - Path to file on system or ip address in network or hostname which we will work

**protocol** - String value of protocol type, can be Connection::PROTOCOL\_TCP, Connection::PROTOCOL\_UDP, Connection::PROTOCOL\_UNIX

**port** - Integer value of port to connect. Not needs if protocol Connection::PROTOCOL\_UNIX. Default value = 0.

**driver** - Object implements StreamDriverInterface. If your connection need to change transfer data you need to describe it logic with this object. Default value is null(mean data haven't been changed)

### Get data from Stream

[](#get-data-from-stream)

```
$stream = new \Stream\Stream($path, $protocol, $port, $driver);
$stream->setReceiveMethod(new StreamGetContentsMethod($maxLength, $offset));
$stream->getContents();
```

**maxLength** - The maximum bytes to read. Default value is -1 (read all the remaining buffer)

**offset** - Seek to the specified offset before reading. Default value is -1 (read without offset)

### Send data to Stream

[](#send-data-to-stream)

```
$stream = new \Stream\Stream($path, $protocol, $port, $driver);
$stream->sendContents($contents);
```

**contents** - can contain any string data

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

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

Recently: every ~330 days

Total

6

Last Release

2955d ago

Major Versions

0.04 → 1.0.02018-04-07

### Community

Maintainers

![](https://www.gravatar.com/avatar/14bf2bc19526615387e37a0e04bb5110ec344663a6bc8e95c3b9947cd5b9808c?d=identicon)[KonstantinKuklin](/maintainers/KonstantinKuklin)

---

Top Contributors

[![KonstantinKuklin](https://avatars.githubusercontent.com/u/573586?v=4)](https://github.com/KonstantinKuklin "KonstantinKuklin (25 commits)")

---

Tags

streamphplibrary

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/konstantin-kuklin-stream-library/health.svg)

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

PHPackages © 2026

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