alesanchezr / json-orm
此包最新版本(0.0.3)没有提供许可证信息。
基于简单JSON文件数据库的PHP引擎。
0.0.3
2019-04-09 20:45 UTC
Requires
- monolog/monolog: ^1.24
Requires (Dev)
- phpunit/phpunit: ^7
This package is auto-updated.
Last update: 2024-09-10 14:12:09 UTC
README
非常简单的基于JSON文件数据库的管理器。
安装
此库可以在Packagist上找到。
推荐的安装方法是使用composer。
编辑你的 composer.json
并添加
{ "require": { "alesanchezr/json-orm": "dev-master" } }
安装依赖项
php composer.phar install
如何使用它?
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');
运行测试
从命令行启动
./vendor/bin/phpunit --bootstrap vendor/autoload.php tests/*
许可证 MIT
联系方式
作者:Alejandro Sanchez