PHPackages                             poirot/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. poirot/storage

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

poirot/storage
==============

An Abstraction key-value store API.

0256PHP

Since May 10Pushed 6y ago3 watchersCompare

[ Source](https://github.com/phPoirot/Storage)[ Packagist](https://packagist.org/packages/poirot/storage)[ RSS](/packages/poirot-storage/feed)WikiDiscussions devel Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Storage
=======

[](#storage)

InMemory Store
--------------

[](#inmemory-store)

```
// Storage for 'test' Realm.

$s = new InMemoryStore('test');
$s->set('name', 'Payam');
$s->set('family', 'Naderi');

$fullname = $s->getFromKeys(['name', 'family']);
$fullname = StdTravers::of($fullname)
    ->each(function($val, $_ ,$prev) {
        return $prev.= ' '.$val;
    });

print_r($fullname);
```

FlatFile Store
--------------

[](#flatfile-store)

```
$s = new FlatFileStore('user_codes');

$user_id = 'd5e110k33f';
$s->set($user_id, '1453');
// Without this syntax storage will save given entity when dispatch shutdown.
$s->save(); // force to save current
```

> In Next Calls

values can be retrieved.

```
$s = new FlatFileStore('user_codes');
if ($s->has('d5e110k33f'))
    print_r($s->get('d5e110k33f'));
```

> Destroy Storage

will destroy storage for given 'user\_codes' realm.

```
$s = new FlatFileStore('user_codes');
$s->destroy();
```

> Choose Desired Options

Options In under\_score with construct

```
$s = new FlatFileStore('user_codes', ['dir_path' => __DIR__.'/my_user_codes.dat']);
$s->set('key', 'value');
```

will map to setter methods

```
$s = new FlatFileStore('user_codes');
$s->setPathDir(__DIR__.'/my_user_codes.dat');
$s->set('key', 'value');
```

Mongo Store
-----------

[](#mongo-store)

```
$client     = \Module\MongoDriver\Actions::Driver()->getClient('master');
$collection = $client->selectCollection('papioniha', 'store.app');

$s = new MongoStore('pass_trough', ['collection' => $collection]);

// Traverse All Data

$v = StdTravers::of( $s )
    ->each(function($val, $key ,$prev) {
        if ( is_array($prev) )
            return $prev[$key] = $val;

        return [$key => $val];
    });

print_r($v);
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.6% 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/1f784f9dfb58e36b6a876f3057e5664bb904af71d30bb2023583118138dffe9a?d=identicon)[Payam](/maintainers/Payam)

---

Top Contributors

[![E1101](https://avatars.githubusercontent.com/u/427575?v=4)](https://github.com/E1101 "E1101 (81 commits)")[![zimberkazmiz](https://avatars.githubusercontent.com/u/2890831?v=4)](https://github.com/zimberkazmiz "zimberkazmiz (2 commits)")

### Embed Badge

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

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

###  Alternatives

[fojuth/readmegen

Readme file / doc generator. It uses VCS logs as a source of information.

6230.7k](/packages/fojuth-readmegen)[fintara/calculator-php

Calculator for arithmetic expressions

1331.2k](/packages/fintara-calculator-php)

PHPackages © 2026

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