PHPackages                             mistericy/storage - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. mistericy/storage

ActiveLibrary[File &amp; Storage](/categories/file-storage)

mistericy/storage
=================

Storage &amp; File System Abstraction Library

00PHPCI passing

Since Mar 15Pushed 1mo agoCompare

[ Source](https://github.com/MisterIcy/storage)[ Packagist](https://packagist.org/packages/mistericy/storage)[ RSS](/packages/mistericy-storage/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

mistericy/storage
=================

[](#mistericystorage)

**Storage &amp; File System Abstraction Library for PHP 8.0+**

[![CI](https://github.com/mistericy/storage/actions/workflows/ci.yml/badge.svg)](https://github.com/mistericy/storage/actions/workflows/ci.yml)[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](LICENSE)

`mistericy/storage` provides a unified, stream-first storage abstraction over multiple backends. Swap between local disk, in-memory, AWS S3, FTP, and custom adapters by injecting a different adapter — no other code changes required.

---

Features
--------

[](#features)

- **Zero mandatory dependencies** — the core library has no required third-party dependencies.
- **Stream-first** — all file content is exchanged as PHP `resource` streams.
- **Interface-segregated** — consumers type-hint only the capabilities they need (`ReadableInterface`, `WritableInterface`, `ListableInterface`, etc.).
- **PHP 8.0 compatible** — works with legacy and modern codebases alike.
- **Trivially testable** — swap in `InMemoryAdapter` during tests, no mocks required.

---

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

[](#installation)

```
composer require mistericy/storage
```

Optional backend packages (install only what you need):

```
# AWS S3 support
composer require aws/aws-sdk-php

# PSR-11 container integration
composer require psr/container

# PSR-3 logging support
composer require psr/log
```

---

Quick Start
-----------

[](#quick-start)

```
use MisterIcy\Storage\Filesystem;
use MisterIcy\Storage\Adapter\InMemoryAdapter;
use MisterIcy\Storage\ValueObject\Path;

$fs = new Filesystem(new InMemoryAdapter());

// Write
$stream = fopen('php://temp', 'r+');
fwrite($stream, 'Hello, world!');
rewind($stream);
$fs->write(new Path('/greetings/hello.txt'), $stream);

// Read
$result = $fs->read(new Path('/greetings/hello.txt'));
echo stream_get_contents($result); // Hello, world!
```

---

Local Development Setup
-----------------------

[](#local-development-setup)

### Prerequisites

[](#prerequisites)

ToolMinimum versionPHP8.0Composer2.x### Clone and install

[](#clone-and-install)

```
git clone https://github.com/mistericy/storage.git
cd storage
composer install
```

### Run the test suite

[](#run-the-test-suite)

```
# Unit tests
./vendor/bin/phpunit

# Static analysis (PHPStan level 9)
./vendor/bin/phpstan analyse

# Coding standards check (read-only)
./vendor/bin/php-cs-fixer fix --dry-run --diff

# Auto-fix coding standards
./vendor/bin/php-cs-fixer fix

# Mutation testing (MSI baseline ≥ 85 %)
./vendor/bin/infection
```

Mutation reports are written to `build/infection/` (HTML, JSON, text, and per-mutator Markdown).

---

Architecture
------------

[](#architecture)

The library is built around a **Strategy Pattern**:

```
Filesystem (facade)
    └── AdapterInterface (strategy)
            ├── InMemoryAdapter
            ├── LocalAdapter        (planned)
            ├── S3Adapter           (planned)
            └── FtpAdapter          (planned)

```

The full design rationale is documented in [docs/adr/0001-core-architecture.md](docs/adr/0001-core-architecture.md).

---

Contributing
------------

[](#contributing)

Contributions are welcome. Please read [CONTRIBUTING.md](CONTRIBUTING.md)before opening an issue or pull request. New adapter proposals follow the **RFC → ADR → PR** process described there.

---

Security
--------

[](#security)

Please **do not** open a public issue for security vulnerabilities. Use [GitHub's private Security Advisory](https://github.com/mistericy/storage/security/advisories/new)instead.

---

Code of Conduct
---------------

[](#code-of-conduct)

This project adheres to the [Contributor Covenant v2.1](CODE_OF_CONDUCT.md). By participating, you agree to uphold its terms.

---

License
-------

[](#license)

MIT © 2026 [Alexandros Koutroulis](https://mistericy.github.io)

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance59

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/2641eef989e48941d7465d5f50f15d245530866df78c044dc907b191f6dca202?d=identicon)[mistericy](/maintainers/mistericy)

---

Top Contributors

[![MisterIcy](https://avatars.githubusercontent.com/u/6999229?v=4)](https://github.com/MisterIcy "MisterIcy (10 commits)")

### Embed Badge

![Health badge](/badges/mistericy-storage/health.svg)

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

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M123](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

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