PHPackages                             switon/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. switon/storage

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

switon/storage
==============

Local filesystem blob storage with safe relative keys under one root for Switon Framework

v1.0.0(1mo ago)00MITPHPPHP &gt;=8.3CI passing

Since Jun 6Pushed 1mo agoCompare

[ Source](https://github.com/switon-php/storage)[ Packagist](https://packagist.org/packages/switon/storage)[ Docs](https://github.com/switon-php/storage)[ RSS](/packages/switon-storage/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

Switon Storage Package
======================

[](#switon-storage-package)

[![Storage CI](https://camo.githubusercontent.com/3d24da17d01b08882953f7211a3e8f7d31b90be150b42f122da2780bd826a872/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f737769746f6e2d7068702f73746f726167652f63692e796d6c3f6272616e63683d6d61696e266c6162656c3d53746f726167652532304349)](https://github.com/switon-php/storage/actions/workflows/ci.yml) [![PHP 8.3+](https://camo.githubusercontent.com/c03f51341eebaefabbf137e291b20523fc74b4ffd084406d88524d266d95085d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e332532422d373737424234)](https://www.php.net/)

Switon's blob storage layer with a filesystem-backed default implementation and a small contract for custom backends.

Highlights
----------

[](#highlights)

- **Small blob contract:** custom backends stay easy to swap in.
- **Filesystem storage:** objects can be stored under a root path with alias resolution.
- **Stream support:** readable and writable streams are supported.
- **File upload path:** files can be written from disk with extension restrictions.
- **Safe keys:** object keys must stay relative.

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

[](#installation)

```
composer require switon/storage
```

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

[](#quick-start)

```
use Switon\Core\Attribute\Autowired;
use Switon\Storage\BlobStoreInterface;

class AvatarService
{
    #[Autowired] protected BlobStoreInterface $blobStore;

    public function save(int $userId, string $bytes): void
    {
        $this->blobStore->put("avatars/{$userId}.bin", $bytes);
    }
}
```

Docs:

License
-------

[](#license)

MIT.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance90

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

48d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dc0f20ad15b0ae9fbf9c6e2cd3008692b0c88a877ec8d3e0119211314bf86fc8?d=identicon)[switon](/maintainers/switon)

---

Top Contributors

[![switon-php](https://avatars.githubusercontent.com/u/247358032?v=4)](https://github.com/switon-php "switon-php (1 commits)")

---

Tags

blobsfilesystemstorageswitonfilesystemstorageswitonblobs

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[league/flysystem

File storage abstraction for PHP

13.6k679.9M2.6k](/packages/league-flysystem)[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.7k285.7M1.1k](/packages/league-flysystem-aws-s3-v3)[league/flysystem-async-aws-s3

AsyncAws S3 filesystem adapter for Flysystem.

3012.1M44](/packages/league-flysystem-async-aws-s3)[gliterd/backblaze-b2

PHP SDK for working with backblaze B2 cloud storage.

83278.7k8](/packages/gliterd-backblaze-b2)[nimbusoft/flysystem-openstack-swift

Flysystem adapter for OpenStack Swift

44818.0k7](/packages/nimbusoft-flysystem-openstack-swift)[cwhite92/b2-sdk-php

A SDK for working with B2 cloud storage.

74154.8k2](/packages/cwhite92-b2-sdk-php)

PHPackages © 2026

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