alesanchezr/json-orm
Composer 安装命令:
composer require alesanchezr/json-orm
包简介
PHP Engine for a simple JSON file based database.
README 文档
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
统计信息
- 总下载量: 529
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2018-11-07