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)069.3k↓13.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 yesterday

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

42

—

FairBetter than 88% of packages

Maintenance40

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

510d 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://avatars.githubusercontent.com/u/16920430?v=4)[ARTEMEON](/maintainers/artemeon)[@artemeon](https://github.com/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

691146.0M211](/packages/react-stream)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[phpseclib/phpseclib2_compat

phpseclib 2.0 polyfill built with phpseclib 3.0

132.1M17](/packages/phpseclib-phpseclib2-compat)[shopware/app-php-sdk

Shopware App SDK for PHP

15109.8k3](/packages/shopware-app-php-sdk)[ycodetech/valet-windows

A more enjoyable local development experience for Windows. A Windows port of the popular Laravel Valet and a fork of cretueusebiu/valet-windows, with new features.

451.7k](/packages/ycodetech-valet-windows)

PHPackages © 2026

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