divengine / nodes
Div PHP Nodes is a Database System for PHP written in PHP
2.0.0
2019-07-04 05:51 UTC
Requires
- php: >=5.4.0
This package is auto-updated.
Last update: 2024-10-29 05:46:58 UTC
README
Div PHP Nodes is a PHP library for storing relational and serialized data without the need for an external server. The data is organized into schemas, and each object (or "node") can be indexed for full-text search and fast lookup.
This class manages file-based databases and provides mechanisms to avoid concurrency issues using file locking. Additionally, it allows:
- Creating, updating, deleting, renaming, and searching for nodes.
- Referencing nodes across different schemas.
- Iterating over nodes using closure functions.
- Indexing node content for quick searches.
- Storing and dynamically updating statistics.
- Managing schemas: creating, renaming, and deleting schema directories.
Installation
With composer...
composer require divengine/nodes
Without composer, download the class and...
include "path/to/divengine/nodes.php";
Basic usage
<?php use divengine/nodes; $db = new nodes("database/contacts"); $id = $db->addNode([ "name" => "Peter", "age" => 25 ]); $db->setNode($id, [ "email" => "peter@email.com", "phone" => "+1222553335" ]); $contact = $db->getNode($id); $db->delNode($id);
Enjoy!