PHPackages                             commentar/json-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. commentar/json-storage

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

commentar/json-storage
======================

This storage mechanism requires no database, but rather stores the data encoded in the JSON format on the filesystem.

v0.0.6(12y ago)084MITPHPPHP &gt;=5.4

Since Sep 11Pushed 12y ago2 watchersCompare

[ Source](https://github.com/Commentar/JsonStorage)[ Packagist](https://packagist.org/packages/commentar/json-storage)[ Docs](https://github.com/Commentar/JsonStorage)[ RSS](/packages/commentar-json-storage/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (7)Used By (0)

JsonStorage
===========

[](#jsonstorage)

[![Build Status](https://camo.githubusercontent.com/958607614bf23465011765d3bd414ba4f664ffdf84e7bb315d8ef936d4b9e1c0/68747470733a2f2f7472617669732d63692e6f72672f436f6d6d656e7461722f4a736f6e53746f726167652e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/Commentar/JsonStorage) [![Scrutinizer Quality Score](https://camo.githubusercontent.com/bdbcf9e4fb932949c0d01dce6bb8009ae9841ab011c4616be58b946a6258cd24/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f436f6d6d656e7461722f4a736f6e53746f726167652f6261646765732f7175616c6974792d73636f72652e706e673f733d63653031396264313133643835396566313537653561376437353535383937646238383161333533)](https://scrutinizer-ci.com/g/Commentar/JsonStorage/) [![Code Coverage](https://camo.githubusercontent.com/043dfa4ac79ecf66c78672b5803c8f00928912c5d1627ad261081c1d95ac38a2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f436f6d6d656e7461722f4a736f6e53746f726167652f6261646765732f636f7665726167652e706e673f733d63613530383638383339613838653433333138323134343236396531313039336433633333363136)](https://scrutinizer-ci.com/g/Commentar/JsonStorage/) [![Latest Stable Version](https://camo.githubusercontent.com/9582064b883026505a415c528547b6b0b00dcedfc6040b2d561a475e1966c6b5/68747470733a2f2f706f7365722e707567782e6f72672f436f6d6d656e7461722f6a736f6e2d73746f726167652f762f737461626c652e706e67)](https://packagist.org/packages/Commentar/json-storage) [![Total Downloads](https://camo.githubusercontent.com/8832f1c6a12060bc7d369f8886dee45f9e04bcacfc03950076e218f3e9e6e783/68747470733a2f2f706f7365722e707567782e6f72672f436f6d6d656e7461722f6a736f6e2d73746f726167652f646f776e6c6f6164732e706e67)](https://packagist.org/packages/Commentar/json-storage)

Storage mechanism for the [Commentar](https://github.com/Commentar/Commentar) project. This storage mechanism requires no database, but rather stores the data encoded in the JSON format on the filesystem.

This should only be used for development purposes to have a portable way of introducing some persistent storage. It should *never* be used in production.

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

[](#installation)

Add the storage mechanism to the project's `composer.json` file:

```
"require": {
    "commentar/json-storage": "0.0.*",
}

```

Add the default admin user in the `/data/users.json` file:

```
{
    "autoincrement": 1,
    "users": {
        "1": {
            "id": 1,
            "username": "PeeHaa",
            "password": "$2y$14$Usk4vuNbzowQihbscOZjcu6RRzPBK3zIn79F8wn.bjczbElrqzbJu",
            "email": "your@mail.com",
            "isHellbanned": false,
            "isAdmin": true
        }
    }
}

```

The password should be hashed using PHP's native password hashing function (`password_hash()`). The easiest way to generate the password hash is by either using [this service](https://passhash.pieterhordijk.com) or by manually running the password hashing function: `echo password_hash('Your super secret password', PASSWORD_DEFAULT, ['cost' => 14]);`.

To start using the storage you will have to start using the provided datamapper factory by this library. An example of retrieving the comment tree of a thread is:

```
$domainObjectFactory = new \Commentar\DomainObject\Factory();
$datamapperFactory   = new \Commentar\Storage\Json\Factory(__DIR__ . '/vendor/commentar/json-storage/data');
$commentService      = new \Commentar\Service\Comment($domainObjectFactory, $datamapperFactory);

$commentTree = $commentService->getTree(1);

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

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

Total

6

Last Release

4604d ago

### Community

Maintainers

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

---

Top Contributors

[![PeeHaa](https://avatars.githubusercontent.com/u/1330296?v=4)](https://github.com/PeeHaa "PeeHaa (26 commits)")

---

Tags

jsonfilesystemstoragecommentscommentar

### Embed Badge

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

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

###  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)[league/flysystem-async-aws-s3

AsyncAws S3 filesystem adapter for Flysystem.

2610.5M31](/packages/league-flysystem-async-aws-s3)[gliterd/backblaze-b2

PHP SDK for working with backblaze B2 cloud storage.

84263.3k8](/packages/gliterd-backblaze-b2)[nimbusoft/flysystem-openstack-swift

Flysystem adapter for OpenStack Swift

44774.4k6](/packages/nimbusoft-flysystem-openstack-swift)[cwhite92/b2-sdk-php

A SDK for working with B2 cloud storage.

74146.6k2](/packages/cwhite92-b2-sdk-php)

PHPackages © 2026

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