1. Go to this page and download the library: Download maer/file-db library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
maer / file-db example snippets
$driver = new SomeStorageDriver();
$db = new Maer\FileDB\FileDB($driver);
$driver = new Maer\FileDB\Storage\FileSystem(
'/absolute-path/to/your/storage/folder'
);
$driver = new Maer\FileDB\Storage\Memory();
$query = $db->table('people');
// or shorthand
$query = $db->people;
// Only get the 2 first matches
$results = $db->people->limit(2)->get();
// Get all results from the second match and forward.
$results = $db->people->offset(2)->get();
// Default, converts the item to a StdClass
$item = $db->people->asObj()->first();
// Using your own entity class
$item => $db->people->asObj('Namespace\PersonClass')->find();