Skip to content

Latest commit

 

History

History
58 lines (38 loc) · 1.92 KB

README.md

File metadata and controls

58 lines (38 loc) · 1.92 KB

Div PHP Nodes

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

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" => "[email protected]",
    "phone" => "+1222553335"
]);

$contact = $db->getNode($id);

$db->delNode($id);

Enjoy!

Documentation