PHPackages                             99designs/cabinet - 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. 99designs/cabinet

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

99designs/cabinet
=================

A filestore abstraction for PHP

1.0.0(12y ago)130.0k1MITPHPPHP &gt;=5.3

Since Aug 26Pushed 11y ago6 watchersCompare

[ Source](https://github.com/99designs/cabinet)[ Packagist](https://packagist.org/packages/99designs/cabinet)[ RSS](/packages/99designs-cabinet/feed)WikiDiscussions master Synced 3w ago

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

Cabinet is a filestore abstraction written in PHP. Filestores map string keys to files.

At the core of Cabinet is the `FileStore` interface, which defines most of the operations you'd find in a normal filesystem (read, write, delete, etc.). By programming to this interface, your application code remains unaware of the underlying filestore implementation.

Abstracting the filestore lets you swap one implementation for another without requiring changes to your application code. For example, you might use S3 in production, a local filesystem in dev, and an array-backed implementation in your unit tests.

Filestore implementations
-------------------------

[](#filestore-implementations)

Cabinet comes with a number of filestore implementations:

- `FilesystemFileStore` stores files in your local filesystem.
- `ArrayFileStore` stores files in a PHP array.
- `NullFileStore` is a black hole like `/dev/null`.

There are two additional wrapper implementations:

- `ReadOnlyFileStore` delegates read and write operations to two separate filestores.
- `MountPointFileStore` provides a way to compose multiple filestores into a virtual filesystem.

To provide a custom implementation, write a class that implements `Cabinet\FileStore`.

Example usage
-------------

[](#example-usage)

You'd typically defer construction of a filestore to a factory constructor:

```
class FileStoreFactory
{
    public static function create() {
        // This might return an implementation based on your app config
        return new \Cabinet\FilesystemFileStore('/tmp/myfiles');
    }
}

```

Then your application code uses the filestore like so:

```
$store = FileStoreFactory::create();
$file = $store->newFile('/foo/bar');
$store->setFileContents($file, 'some data');
$store->close($file);

```

This writes the given data to `/tmp/myfiles/foo/bar`.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.5% 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

4690d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/61d94165c13417941a32d14d4468f27868c7643e96495090cfd33009055ea48c?d=identicon)[mtibben](/maintainers/mtibben)

![](https://avatars.githubusercontent.com/u/1178572?v=4)[Giacomo Gatelli](/maintainers/arthens)[@arthens](https://github.com/arthens)

![](https://avatars.githubusercontent.com/u/29794?v=4)[Paul Leitmanis](/maintainers/sinamt)[@sinamt](https://github.com/sinamt)

---

Top Contributors

[![harto](https://avatars.githubusercontent.com/u/103448?v=4)](https://github.com/harto "harto (14 commits)")[![DanielHeath](https://avatars.githubusercontent.com/u/47430?v=4)](https://github.com/DanielHeath "DanielHeath (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/99designs-cabinet/health.svg)

```
[![Health](https://phpackages.com/badges/99designs-cabinet/health.svg)](https://phpackages.com/packages/99designs-cabinet)
```

###  Alternatives

[venveo/craft-compress

Create smart zip files from Craft assets on the fly

124.7k](/packages/venveo-craft-compress)

PHPackages © 2026

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