Changelog
All notable changes to this project will be documented here.
[2.0.0] - 2023-01-25
New features
- 🌟 Added Encryption mechanism to the documents. You can now encrypt and decrypt all your documents by passing an encryption array to the config settings as shown below;
require_once __DIR__."/vendor/autoload.php";
/**
* @settings array $encryption
* @param key_storage_path - The path to where your encryption keys are stored
* @key_name - The name of your key which points to the name of the key file (Store this name in your database)
*/
$db = new \Filebase\Database([
'dir' => __DIR__.'/databases',
'encryption' => array('key_storage_path' => __DIR__.'/encrypter', 'key_name' => 'test')
]);
$db->flush(true);
$user = $db->get(uniqid());
$user->name = 'John';
$user->email = '[email protected]';
$user->save();
$db->where('name','=','John')->andWhere('email','==','[email protected]')->select('email')->results();
$result_from_cache = $db->where('name','=','John')->andWhere('email','==','[email protected]')->select('email')->results();
print_r($result_from_cache);