prowebcraft / php-json-db
Simple And Flexible database in JSON file
Installs: 1 708
Dependents: 1
Suggesters: 0
Security: 0
Stars: 5
Watchers: 1
Forks: 2
Open Issues: 0
Requires
- prowebcraft/dot: @dev
Requires (Dev)
README
Simple And Flexible database in JSON file
#Installation
composer require prowebcraft/php-json-db
#Usage Create JsonDb instance
$db = new \Prowebcraft\JsonDb([ 'name' => 'users.json', 'dir' => getcwd() ]);
Add some data
$db->set('user', [ 'firstname' => 'John', 'lastname' => 'Doe' ]);
Add more data to existing array
$db->set('user.age', 18);
Save data to storage
$db->save();
You will get file in current working directory named users.json with sample data:
{ "user": { "firstname": "John", "lastname": "Doe", "age": 18 } }
Get items
$db->get('user.age');