PHPackages                             elfet/pure - 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. elfet/pure

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

elfet/pure
==========

Pure PHP key-value storage

v3.0.0(7y ago)881.7M—1%11[2 issues](https://github.com/elfet/purephp/issues)[1 PRs](https://github.com/elfet/purephp/pulls)2MITPHP

Since Mar 12Pushed 7y ago6 watchersCompare

[ Source](https://github.com/elfet/purephp)[ Packagist](https://packagist.org/packages/elfet/pure)[ RSS](/packages/elfet-pure/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (7)Versions (7)Used By (2)

PurePHP Key-Value Storage
=========================

[](#purephp-key-value-storage)

[![Build Status](https://camo.githubusercontent.com/232cc1b2cdcf02493e288d274e4eeb031b6e299daf8bde521e211e6af12bb96f/68747470733a2f2f7472617669732d63692e6f72672f616e746f6e6d6564762f707572657068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/antonmedv/purephp)

This is simple key-value storage written on PHP. It does not use files, or other database, just pure PHP.

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

[](#installation)

Via Composer:

```
composer require elfet/pure

```

Now you can run pure like this: `php vendor/bin/pure`

Or you can install PurePHP globally to run pure by `pure` command.

Quick Guide
-----------

[](#quick-guide)

Start PurePHP by this command:

```
pure start &

```

Now PurePHP server is running. Run this command:

```
pure client

```

Now you can test PurePHP by simple commands like this:

```
> pure.queue.collection.push('hello')
> pure.queue.collection.push('world')
> pure.queue.collection.pop() ~ ' ' ~ pure.queue.collection.pop()
string(11) "hello world"

```

In pure console you can write commands on [Expression Language](https://github.com/symfony/expression-language). To exit from console type `exit` command.

Documentation
-------------

[](#documentation)

### Connection to PurePHP server

[](#connection-to-purephp-server)

```
$port = 1337; // Default port value
$host = '127.0.0.1'; // Default host value
//...
$pure = new Pure\Client($port, $host);
```

### Storages

[](#storages)

PurePHP provide different types on storages. All supported storages are in [src/Storage](https://github.com/elfet/purephp/tree/master/src/Storage). You can access them by next methods and work with them like you work with them directly.

You do not need to manually create any collection. They will be automatically create at first access.

```
$pure->map('collection')->...
$pure->stack('collection')->...
$pure->queue('collection')->...
$pure->priority('collection')->...
```

Or you can access them by magic methods.

```
$pure->map->collection->...
$pure->stack->collection->...
$pure->queue->collection->...
//...
```

### Array Storage `->map`

[](#array-storage--map)

This is simple storage what uses php array to store your data.

To store date in collection use `push` method:

```
$pure->map('collection')->push(['hello' => 'world']);
```

To get value by key from collection use `get` method:

```
$value = $pure->map('collection')->get('hello'); // will return 'world'.
```

To receive all elements use `all` method:

```
$all = $pure->map('collection')->all();
```

You can check if key exist by `has` method, and delete element by `delete` method.

### Stack Storage `->stack`

[](#stack-storage--stack)

This storage use `SplStack` to store your data.

You can use all `SplStack` methods and also `all` method.

### Queue Storage `->queue`

[](#queue-storage--queue)

This storage use `SplQueue` to store your data.

You can use `SplQueue` methods and also `all` method.

`SplQueue` uses `enqueue` and `deenqueue` to push and pop from queue. In QueueStorage your can use `push` and `pop` methods to do this.

### Priority Queue Storage `->priority`

[](#priority-queue-storage--priority)

This storage use `SplPriorityQueue` to store your data.

You can use all `SplPriorityQueue` methods and also `all` method.

### Filtering

[](#filtering)

Every storage support function `filter`.

Example:

```
// Get all elements that more than a 100.
$result = $pure->queue('collection')->filter('value > 100');

// Limit to 10.
$result = $pure->priority('collection')->filter('value > 100', 10);

// Complex expression.
$result = $pure->of('collection')->filter('value["year"] > 2000 and value["name"] matches "/term/"');
```

Filter rules uses [Expression Language](https://github.com/symfony/expression-language). In expression available two variables: `key` and `value`.

### Deleting

[](#deleting)

You can delete storages by `delete` method:

```
$pure->delete('collection');

```

TODO
----

[](#todo)

- Dump to file
- Load from file
- Replication
- Sharding

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity52

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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 ~329 days

Recently: every ~410 days

Total

6

Last Release

2800d ago

Major Versions

v0.2.1 → v1.0.02014-12-23

v1.1.0 → v2.0.02016-03-19

v2.0.0 → v3.0.02018-09-18

### Community

Maintainers

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

---

Top Contributors

[![antonmedv](https://avatars.githubusercontent.com/u/141232?v=4)](https://github.com/antonmedv "antonmedv (3 commits)")[![flug](https://avatars.githubusercontent.com/u/1810304?v=4)](https://github.com/flug "flug (1 commits)")[![mbrodala](https://avatars.githubusercontent.com/u/5037116?v=4)](https://github.com/mbrodala "mbrodala (1 commits)")[![sndsgd](https://avatars.githubusercontent.com/u/5289973?v=4)](https://github.com/sndsgd "sndsgd (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/elfet-pure/health.svg)

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

###  Alternatives

[vich/uploader-bundle

Ease file uploads attached to entities

1.9k25.9M116](/packages/vich-uploader-bundle)[artgris/filemanager-bundle

FileManager is a simple Multilingual File Manager Bundle for Symfony

182420.8k9](/packages/artgris-filemanager-bundle)[vinelab/cdn

Content Delivery Network (CDN) Package for Laravel

217240.8k1](/packages/vinelab-cdn)

PHPackages © 2026

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