PHP code example of dwgebler / doclite

1. Go to this page and download the library: Download dwgebler/doclite 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/ */

    

dwgebler / doclite example snippets


use Gebler\Doclite\FileDatabase;

$db = new FileDatabase('./data');
$users = $db->collection('users');

$alice = $users->get();
$alice->setValue('name', 'Alice');
$alice->setValue('email', '[email protected]');
$alice->save();

$found = $users->findOneBy(['email' => '[email protected]']);
echo $found->getValue('name'); // Alice