2017 © Pedro Peláez
 

library json-storage

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

image

commentar/json-storage

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

  • Saturday, October 5, 2013
  • by PeeHaa
  • Repository
  • 2 Watchers
  • 0 Stars
  • 72 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

JsonStorage

Build Status Scrutinizer Quality Score Code Coverage Latest Stable Version Total Downloads, (*1)

Storage mechanism for the Commentar project. This storage mechanism requires no database, but rather stores the data encoded in the JSON format on the filesystem., (*2)

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., (*3)

Installation

Add the storage mechanism to the project's composer.json file:, (*4)

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

Add the default admin user in the /data/users.json file:, (*5)

{
    "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 or by manually running the password hashing function: echo password_hash('Your super secret password', PASSWORD_DEFAULT, ['cost' => 14]);., (*6)

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:, (*7)

$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);

The Versions

05/10 2013

dev-master

9999999-dev https://github.com/Commentar/JsonStorage

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

  Sources   Download

MIT

The Requires

  • php >=5.4

 

filesystem json comments storage commentar

05/10 2013

v0.0.6

0.0.6.0 https://github.com/Commentar/JsonStorage

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

  Sources   Download

MIT

The Requires

  • php >=5.4

 

filesystem json comments storage commentar

28/09 2013

v0.0.5

0.0.5.0 https://github.com/Commentar/JsonStorage

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

  Sources   Download

MIT

The Requires

  • php >=5.4

 

filesystem json comments storage commentar

14/09 2013

v0.0.4

0.0.4.0 https://github.com/Commentar/JsonStorage

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

  Sources   Download

MIT

The Requires

  • php >=5.4

 

filesystem json comments storage commentar

14/09 2013

v0.0.3

0.0.3.0 https://github.com/Commentar/JsonStorage

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

  Sources   Download

MIT

The Requires

  • php >=5.4

 

filesystem json comments storage commentar

14/09 2013

v0.0.2

0.0.2.0 https://github.com/Commentar/JsonStorage

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

  Sources   Download

MIT

The Requires

  • php >=5.4

 

filesystem json comments storage commentar

11/09 2013

v0.0.1

0.0.1.0 https://github.com/Commentar/JsonStorage

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

  Sources   Download

MIT

The Requires

  • php >=5.4

 

filesystem json comments storage commentar