Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.

Added Encryption to the project and updated the readme #73

Open
wants to merge 64 commits into
base: master
Choose a base branch
from

Conversation

mitmelon
Copy link

(11) Encryption Added

  • 🌟 Added Encryption mechanism to the document. 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);

The above will encrypt your document when creating and decrypt it when fetching or quering. Please note that its required that you have the extension Sodium installed to use the encryption mechanism.

timothymarois and others added 30 commits August 16, 2018 23:18
…ts() change indexes from chronological integers to document Id. Adding the ID within the array key allows a reference the original document.
…tDocuments() change indexes from chronological integers to document Id. Adding the ID within the array key allows a reference the original document."

This reverts commit 1e413bb.
…ndling

Json format: refactor error handling + add JSON_UNESCAPED_UNICODE
*new_feature: delete items with custom filter
timothymarois and others added 30 commits February 22, 2019 23:45
Added support for order by multiple columns
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants