PHPackages                             irfantoor/datastore - 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. irfantoor/datastore

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

irfantoor/datastore
===================

Data Store of key, value pairs

0.4.1(5y ago)032MITPHPPHP &gt;= 7.3

Since Sep 25Pushed 5y ago1 watchersCompare

[ Source](https://github.com/irfantoor/datastore)[ Packagist](https://packagist.org/packages/irfantoor/datastore)[ RSS](/packages/irfantoor-datastore/feed)WikiDiscussions main Synced 2d ago

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

Datastore
=========

[](#datastore)

Storage of an key, value pair to a filesystem

Quick Start
===========

[](#quick-start)

Incstallation or inclusion in your project:

```
$ composer require irfantoor/datastore
```

Creating the Datastore:

```
$ds = new IrfanTOOR\Datastore('/yourpath/to/datatore/');
```

has($id)
--------

[](#hasid)

Verify if the store has an entity with the requested id. returns true or false

```
$ds = new IrfanTOOR\Datastore('/yourpath/to/datatore/');

if ($ds->has('hello')) {
	echo $ds->get('hello');
}
```

set($id, $value, $meta = \[\])
------------------------------

[](#setid-value-meta--)

Sets the value of an id:

```
$ds->set('hello', 'Hello');
$ds->set('hello-world', 'Hello World!');
# ...
```

Any other information regarding can be stored using the 3rd argument $meta.

```
$meta = [
    'meta' => [
        'keywords' => 'hello, world',
        'author'   => 'Jhon Doe',
        # ...
    ];
];

$ds->setComponents('hello', 'Hello World!', $meta);
```

info($id)
---------

[](#infoid)

You can use the function `info` to retrive the information of an entity:

```
$info = $ds->info('hello-world');
print_r($info);

# Note: the information does not contain the value, which can be retrieved using
# the get function
```

get($id)
--------

[](#getid)

Returns the value associated to an id:

```
$contents = $ds->get('hello', 'Hello');
echo $contents;
echo $ds->get('hello-world');
```

remove($id)
-----------

[](#removeid)

Removes an entity assosiated to the provided id:

```
$ds->remove('hello');
```

addFile($key, $file, $meta = \[\])
----------------------------------

[](#addfilekey-file-meta--)

You can add a file to the datastore, using this function.

```
$file = 'absolute\path\to\your\reference_file.txt';

$ds->addFile('reference', $file);

# or you can add some meta information
$ds->addFile('reference', $file, ['keywords' => 'reference', 'sites', 'index', '...']);
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Every ~60 days

Recently: every ~165 days

Total

15

Last Release

1937d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ed3b4bece580a28a0dd93c938b3336d8f73b80a3dda7f5e5881553a22dad83be?d=identicon)[Irfan TOOR](/maintainers/Irfan%20TOOR)

---

Top Contributors

[![irfantoor](https://avatars.githubusercontent.com/u/74845?v=4)](https://github.com/irfantoor "irfantoor (14 commits)")

---

Tags

filesystemdatakey value storage

### Embed Badge

![Health badge](/badges/irfantoor-datastore/health.svg)

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

###  Alternatives

[league/flysystem

File storage abstraction for PHP

13.6k639.1M2.2k](/packages/league-flysystem)[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M790](/packages/league-flysystem-aws-s3-v3)[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[knplabs/knp-gaufrette-bundle

Allows to easily use the Gaufrette library in a Symfony project

72528.6M91](/packages/knplabs-knp-gaufrette-bundle)[league/flysystem-local

Local filesystem adapter for Flysystem.

226231.8M39](/packages/league-flysystem-local)[oneup/flysystem-bundle

Integrates Flysystem filesystem abstraction library to your Symfony project.

64422.9M66](/packages/oneup-flysystem-bundle)

PHPackages © 2026

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