noccylabs/felt

$ git tag


$ git branch
* master

Fast Embedded Library Toolkit

FELT takes your data, serializes it, and writes it together with a handy dandy library class to a file, ready to be included and used out of the box with no dependencies.

Usage

$my_data = [
    [ "name"=>"John Doe", "age"=>42, "sex"=>"m" ],
    [ "name"=>"Alice Doe", "age"=>39, "sex"=>"f" ],
];
$builder = new Felt\Builder();
$builder->setData("data",$my_data);
$builder->write("datalib.php");

...

$lib = require_once "datalib.php";

// it is iterable
foreach ($lib->data as $record) {
    printf("name: %s, age: %d\n", $record['name'], $record['age']);
}

// find stuff
$data = $lib->data->findAll();
$data = $lib->data->findBySex("m");
$record = $lib->data->findOneBySex("m");