Skip to content

Commit e25d897

Browse files
committed
Merge branch 'master' of github.com:alesanchezr/json-orm
2 parents b90af42 + d565a38 commit e25d897

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

travis.yml renamed to .travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ php:
55
install:
66
- composer install
77
script:
8-
- ./vendor/bin/phpunit --bootstrap vendor/autoload.php tests/*
8+
- ./vendor/bin/phpunit --bootstrap vendor/autoload.php tests/*

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# JSON PDO
22

3-
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/alesanchezr/json-orm/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/emmanuelroecker/php-linkchecker/?branch=master)
4-
[![Build Status](https://travis-ci.org/alesanchezr/json-orm.svg?branch=master)](https://travis-ci.org/emmanuelroecker/php-linkchecker)
5-
[![Coverage Status](https://coveralls.io/repos/github/alesanchezr/json-orm/badge.svg?branch=master)](https://coveralls.io/github/emmanuelroecker/php-linkchecker?branch=master)
3+
[![Build Status](https://travis-ci.org/alesanchezr/json-orm.svg?branch=master)](https://travis-ci.org/alesanchezr/json-orm)
4+
[![Coverage Status](https://coveralls.io/repos/github/alesanchezr/json-orm/badge.svg?branch=master)](https://coveralls.io/github/alesanchezr/json-orm?branch=master)
65

76
Very simple JSON file based database manager.
87

@@ -28,13 +27,27 @@ Install dependencies :
2827
php composer.phar install
2928
```
3029

31-
## How to check links in html / json files ?
30+
## How use it?
3231

3332
```php
3433
require 'vendor/autoload.php';
3534

3635
use JsonPDO\JsonPDO;
3736

37+
//create a database pointing to a file or folder
38+
$orm = new JsonPDO('./tests/data/');
39+
40+
//get any file from the data folder
41+
$content = $orm->getJsonByName('countries');
42+
43+
//save some data into a json file
44+
$someData = [ "ve" => "venezuela" ];
45+
$file = $orm->toNewFile('countries');
46+
$file->save($content);
47+
48+
//delete a json file
49+
$orm->deleteFile('countries');
50+
3851
```
3952

4053
## Running Tests
@@ -49,4 +62,4 @@ Launch from command line :
4962

5063
## Contact
5164

52-
Authors : Alejandro Sanchez
65+
Authors : Alejandro Sanchez

0 commit comments

Comments
 (0)