alesanchezr / json-orm
PHP Engine for a simple JSON file based database.
Installs: 525
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/alesanchezr/json-orm
Requires
- monolog/monolog: ^1.24
Requires (Dev)
- phpunit/phpunit: ^7
This package is auto-updated.
Last update: 2025-10-10 16:28:22 UTC
README
Very simple JSON file based database manager.
Installation
This library can be found on Packagist.
The recommended way to install is through composer.
Edit your composer.json
and add :
{ "require": { "alesanchezr/json-orm": "dev-master" } }
Install dependencies :
php composer.phar install
How use it?
require 'vendor/autoload.php'; use JsonPDO\JsonPDO; //create a database pointing to a file or folder $orm = new JsonPDO('./tests/data/'); //get any file from the data folder $content = $orm->getJsonByName('countries'); //save some data into a json file $someData = [ "ve" => "venezuela" ]; $file = $orm->toNewFile('countries'); $file->save($content); //check if a json file exists $exists = $orm->jsonExists('countries'); //if there are several json files, you can list them all $allFiles = $orm->getAllFiles(); //delete a json file $orm->deleteFile('countries');
Running Tests
Launch from command line :
./vendor/bin/phpunit --bootstrap vendor/autoload.php tests/*
License MIT
Contact
Authors : Alejandro Sanchez