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

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

medz/stream-wrapper-interface
=============================

Common interface for streamWrapper class.

v1.0.1(9y ago)22531[1 PRs](https://github.com/medz/stream-wrapper-interface/pulls)1MITPHPPHP &gt;=5.3

Since Sep 1Pushed 7y ago1 watchersCompare

[ Source](https://github.com/medz/stream-wrapper-interface)[ Packagist](https://packagist.org/packages/medz/stream-wrapper-interface)[ Docs](http://medz.cn)[ RSS](/packages/medz-stream-wrapper-interface/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)DependenciesVersions (4)Used By (1)

README - en
===========

[](#readme---en)

This repository holds all interfaces defined by [streamWrapper](http://www.php.net/manual/en/class.streamwrapper.php).

An instance of this class is initialized as soon as a stream function tries to access the protocol it is associated with.

⚠️*Note:*This is NOT a real class, only a prototype of how a class defining its own protocol should be.

关于 - 中文
=======

[](#关于---中文)

这个包实现了[streamWrapper](http://php.net/manual/zh/class.streamwrapper.php)中所要求的所有接口

这个接口类的实例将可以注册后使用流的形势访问。

⚠️*️注意：*这个包的class不是一个实例，而是一个可以规范实例需要完成的方法的接口类。

Composer
========

[](#composer)

```
composer require medz/stream-wrapper-interface
```

Demo
====

[](#demo)

```
use Medz\Component\WrapperInterface\WrapperInterface

class DemoStream implements WrapperInterface
{
    /**
     * Enter description here...
     *
     * @param string $path
     * @param string $mode
     * @param int    $options
     * @param string &$opened_path
     *
     * @return bool
     */
    public function stream_open($path, $mode, $options, &$opened_path)
    {
        // TODO
    }
}
```

Register this object as stream wrapper. 注册这个streamWrapper.
----------------------------------------------------------

[](#register-this-object-as-stream-wrapper-注册这个streamwrapper)

```
stream_register_wrapper('demo', 'DemoStream');
```

use the wrapper client. 使用这个注册的自定义流协议。
--------------------------------------

[](#use-the-wrapper-client-使用这个注册的自定义流协议)

```
// get
file_get_contents('demo://test.txt');

// put
file_put_contents('demo://test.txt', 'This is a test content.');
```

Use vendor package. 使用第三方包
--------------------------

[](#use-vendor-package-使用第三方包)

`(symfony/finder)`:

```
use Symfony\Component\Finder\Finder;

$finder = new Finder();
$finder->files()->in('demo://src');

foreach ($finder as $file)
{
    var_dump($file);
}
```

Use the package for Aliyun OSS SDK. 使用这个接口的阿里云sdk。
==================================================

[](#use-the-package-for-aliyun-oss-sdk-使用这个接口的阿里云sdk)

[medz/oss-stream-wrapper](https://packagist.org/packages/medz/oss-stream-wrapper) alias [medz/aliyun-oss](https://packagist.org/packages/medz/aliyun-oss)

License:
========

[](#license)

MIT

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Total

2

Last Release

3540d ago

PHP version history (2 changes)v1.0.0PHP &gt;=5.4

v1.0.1PHP &gt;=5.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5564821?v=4)[Seven Du](/maintainers/medz)[@medz](https://github.com/medz)

---

Tags

phpinterfacewrapperstreamwrappermedzwrapperInterface

### Embed Badge

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

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

###  Alternatives

[samrap/acf-fluent

A fluent interface for the Advanced Custom Fields WordPress plugin

28656.0k4](/packages/samrap-acf-fluent)[wujunze/money-wrapper

MoneyPHP Wrapper

113.8k](/packages/wujunze-money-wrapper)

PHPackages © 2026

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