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

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

artemeon/stream-context
=======================

Library to create a stream context

1.0.1(1y ago)065.3k↑14.3%MITPHPPHP &gt;=8.4CI passing

Since Jul 20Pushed 1y ago2 watchersCompare

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

READMEChangelog (4)Dependencies (9)Versions (5)Used By (0)

Artemeon Stream-Contexts
========================

[](#artemeon-stream-contexts)

PHP-Interface for the internal PHP stream context's

Description
-----------

[](#description)

Contains several PHP stream context objects to provide an easier interface for the internal wrapper based PHP contexts options. Provides a FileStream configuration object, this allows us to transparent change the streams without to change the client class.

Getting Started
---------------

[](#getting-started)

### Dependencies

[](#dependencies)

- We use the  to user SFTP based on custom StreamWrapper provided by this library.
- In most PHP distributions SFTP support is not compiles in.

### Installing

[](#installing)

```
"require": {
  "artemeon/stream-context": "^0.1.0"
}

```

### Usage

[](#usage)

Basic usage wit all PHP stream aware functions

```
$directory = dir("sftp://ftp.example.com/file.txt", SftpStreamContext::forPasswordAuthentication('password', 'user')->createStreamContext());

```

Usage with the FileObjectFactory and the FileStream object

```
$fileObject = FileObjectFactory::create(FileStream::fromUrl('sftp://test.de/basefolder', SftpStreamContext::forPrivateKeyAuthentication('Aefs566456DG_fgdf')));
$fileObject = FileObjectFactory::create(FileStream::fromUrl('http://test.de/basefolder', HttpStreamContext::forPostUrlencoded(['type' => 'internal'])));

```

Set several Context and FileStream options

```
$httpContext = HttpStreamContext::forGet();
$httpContext->setTimeout(5.0);

$fileStream = FileStream::fromUrl('http://test.de/basefolder/import.csv', $httpContext);
$fileStream->setMode('r+');
$fileStream->enforceFileExtension('csv');

$file = FileObjectFactory::create($fileStream);

```

Version History
---------------

[](#version-history)

- 0.1.0 Initial release

License
-------

[](#license)

This project is licensed under the MIT License - see the LICENSE file for details

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance42

Moderate activity, may be stable

Popularity29

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 71% 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 ~433 days

Total

4

Last Release

464d ago

Major Versions

0.1.1 → 1.0.12025-02-08

PHP version history (2 changes)0.1.0PHP &gt;=7.4

1.0.1PHP &gt;=8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c87366e3237b8eed0a163e8a3c14a76418d7a82d34911d205585457a361ea8d?d=identicon)[artemeon](/maintainers/artemeon)

---

Top Contributors

[![marcreichel](https://avatars.githubusercontent.com/u/7645035?v=4)](https://github.com/marcreichel "marcreichel (22 commits)")[![dsimons70](https://avatars.githubusercontent.com/u/59838853?v=4)](https://github.com/dsimons70 "dsimons70 (5 commits)")[![chriskapp](https://avatars.githubusercontent.com/u/2505846?v=4)](https://github.com/chriskapp "chriskapp (2 commits)")[![tmArtemeon](https://avatars.githubusercontent.com/u/187274518?v=4)](https://github.com/tmArtemeon "tmArtemeon (2 commits)")

---

Tags

streamContext

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[react/stream

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

689126.8M194](/packages/react-stream)[trafficcophp/bytebuffer

Node.js inspired byte stream buffer for PHP.

33437.2k17](/packages/trafficcophp-bytebuffer)[kartik-v/yii2-nav-x

An extended bootstrap Nav widget for Yii 2 with submenu drilldown.

27564.8k6](/packages/kartik-v-yii2-nav-x)[markrogoyski/itertools-php

Iteration tools for PHP

14911.3k](/packages/markrogoyski-itertools-php)[alexandre-daubois/lazy-stream

Write data to streams, only when it is really needed to.

755.7k](/packages/alexandre-daubois-lazy-stream)

PHPackages © 2026

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