Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/asgrim/yamldb
Don't use this, please.
https://github.com/asgrim/yamldb
Last synced: 14 days ago
JSON representation
Don't use this, please.
- Host: GitHub
- URL: https://github.com/asgrim/yamldb
- Owner: asgrim
- Created: 2019-06-09T12:13:07.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-07-19T09:54:34.000Z (over 5 years ago)
- Last Synced: 2024-10-12T12:17:50.700Z (about 1 month ago)
- Language: PHP
- Size: 91.8 KB
- Stars: 35
- Watchers: 3
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# YamlDb
Note: this is a silly project, not intended for production.
This library allows you to use a YAML file as a database in a PHP project.
[![CircleCI](https://circleci.com/gh/asgrim/yamldb/tree/master.svg?style=svg)](https://circleci.com/gh/asgrim/yamldb/tree/master)
## Installation
Install with `composer require asgrim/yamldb`.
## Usage
```php
use Asgrim\YamlDb\Database\FlysystemBackedYamlDb;
use League\Flysystem\Adapter\Local;
use League\Flysystem\Filesystem;$yamlDb = new FlysystemBackedYamlDb(new Filesystem(new Local('/var/lib/yamldb')));
$generatedId = $yamlDb->insert(['foo' => 'bar']);
// Later...
$myData = $yamlDb->findById($generatedId); // ['foo' => 'bar']
```## Why
Why not.