PHPackages                             derywat/php-simple-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. derywat/php-simple-storage

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

derywat/php-simple-storage
==========================

Simple PHP library for storing key =&gt; value data.

0.1.1(3mo ago)023MITPHP

Since Dec 11Pushed 3mo agoCompare

[ Source](https://github.com/derywat/php-simple-storage)[ Packagist](https://packagist.org/packages/derywat/php-simple-storage)[ RSS](/packages/derywat-php-simple-storage/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

Simple PHP library for storing key =&gt; value data.
====================================================

[](#simple-php-library-for-storing-key--value-data)

Caution

Interface and classes methods are NOT STABLE until anounced.

Overview
========

[](#overview)

Library allows persisting data in key =&gt; value format using predefined or custom storage classes.

Included storage classes
========================

[](#included-storage-classes)

JSON file storage (SimpleLocalStorageJSONFile class)
----------------------------------------------------

[](#json-file-storage-simplelocalstoragejsonfile-class)

Class SimpleLocalStorageJSONFile uses JSON file for permanent storage.

### Creating storage object:

[](#creating-storage-object)

```
$ps = new SimpleLocalStorageJSONFile();
$ps->setStorageFileName('storage/json_persisted_file.txt');
```

Created object contains values read from file.

### Accessing values:

[](#accessing-values)

Accessing value by key:

```
$value = $ps->getValue('keyname');
```

Getting all stored values:

```
$allValues = $ps->getValues();
```

### Persisting values:

[](#persisting-values)

Setting value automatically persist all values to file.
Value must be serializable in JSON format.

```
$ps->setValue('keyname',$value);
```

Unsetting value also persists all values to file.

```
$ps->unsetValue('keyname');
```

Implementing custom storage classes
===================================

[](#implementing-custom-storage-classes)

Custom storage can be implemented by extending SimpleLocalStorage abstract class.

```
class NewSimpleStorageClass extends SimpleLocalStorage implements SimpleLocalStorageInterface {

	protected function _persist():void {
		//prepare $this->values for persistent storage
		//write or send data to storage or update changed data in storage
	}

	protected function _load():void {
		//load persisted data here
		$this->values = $loadedDataArray;
	}

}
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance80

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 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 ~54 days

Total

2

Last Release

104d ago

### Community

Maintainers

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

---

Top Contributors

[![derywat](https://avatars.githubusercontent.com/u/46571114?v=4)](https://github.com/derywat "derywat (2 commits)")

### Embed Badge

![Health badge](/badges/derywat-php-simple-storage/health.svg)

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

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15161.6M2.6k](/packages/illuminate-filesystem)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)[madnest/madzipper

Easier zip file handling for Laravel applications.

1382.3M6](/packages/madnest-madzipper)

PHPackages © 2026

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