div
Template engine and code generator with recursive compilation and custom dialects.
Divengine
Open Source Ecosystem
Divengine Software Solutions
From templates and routing to data engines and knowledge maps, each project is designed to stay small, composable, and easy to extend. Together they form a toolkit for shipping pragmatic software across languages and runtimes. Contributions are welcome in every repository.
Open-source first
Built in public, improved by contributors, and shared openly.
Composable building blocks
Small libraries that do one job well and integrate cleanly.
Ecosystem mindset
Shared patterns across projects keep your stack coherent.
Ecosystem
Divengine libraries share a pragmatic philosophy: explicit mappings, readable code, and minimal dependencies. Each project stands alone, yet they connect naturally when combined.
Project Atlas
Each library solves a focused problem. Pick one, or combine them to shape a lightweight stack.
A PHP template engine and code generator with recursive compilation and custom dialects.
View on GitHubA control-point router for HTTP and CLI flows with hooks, rules, and modular dispatch.
View on GitHubSpreadsheet-like matrices with formulas, ranges, and export formats like CSV, JSON, and SQL.
View on GitHubGenerates Obsidian vaults from Python codebases, mapping modules, classes, and call relationships.
View on GitHubLazy immutable values backed by closures and optional constraints for safe runtime config.
View on GitHubA class-based enum pattern with inheritance for legacy PHP and polymorphic workflows.
View on GitHubExpose PHP functions and static methods to the browser through a focused AJAX mapping layer.
View on GitHubA file-based node database with schemas, indexing, and lightweight search.
View on GitHubA minimal ORM that maps records and tables to PHP objects with explicit class hierarchies.
View on GitHub<?php
require 'vendor/autoload.php';
use divengine\div;
echo new div('Hello {$name}', ['name' => 'Divengine']);
Outputs: Hello Divengine.
<?php
require 'vendor/autoload.php';
use divengine\ways;
ways::listen("get://home", function($data) {
echo "Hello {$data['user']}";
}, "home");
ways::hook(DIV_WAYS_BEFORE_RUN, "home", function($data) {
$data['user'] = "Peter";
});
ways::bootstrap('_url', 'home');
Outputs Hello Peter when the home control point runs.
<?php
require 'vendor/autoload.php';
use divengine\matrix;
$nums = new matrix([
["", 1, 2, 3],
["", 4, 5, 6],
]);
echo $nums->get(1, 3);
6
pyvault ./my_project ./vault_output
Creates an Obsidian vault with module pages, class maps, and navigation indexes.
<?php
require 'vendor/autoload.php';
use divengine\laze;
laze::define('APP_NAME', fn () => 'Laze Demo');
echo laze::read('APP_NAME');
Prints Laze Demo and caches the evaluated value.
<?php
require 'vendor/autoload.php';
use divengine\enum;
abstract class Temperature extends enum {}
class HOT extends Temperature {}
class COLD extends Temperature {}
function advise(Temperature $t): string
{
if ($t instanceof HOT) {
return 'Drink water';
}
return 'Wear a coat';
}
echo advise(new HOT());
Outputs Drink water for the HOT enum.
server.php
<?php
require __DIR__ . '/vendor/autoload.php';
use divengine\ajaxmap;
function sum($x, $y) {
return $x + $y;
}
class Enterprise {
public static function getEmployees() {
return [
["name" => "Thomas Hardy", "salary" => 1500],
["name" => "Christina Berglund", "salary" => 1200],
];
}
}
$server = new ajaxmap();
$server->addMethod('sum');
$server->addClass('Enterprise');
$server->go();
index.html
<script src="server.php?lib"></script>
<script>
var api = new ajaxmap("server.php");
var result = api.sum(20, 10);
var employees = api.Enterprise.getEmployees();
console.log(result, employees[0].name);
</script>
The client logs 30 and the first employee name from PHP.
<?php
require 'vendor/autoload.php';
use divengine\nodes;
$db = new nodes("database/contacts");
$id = $db->addNode([
"name" => "Peter",
"age" => 25
]);
$contact = $db->getNode($id);
Returns the stored contact data from the file database.
<?php
require 'vendor/autoload.php';
use divengine\orm;
class PublicMap extends orm
{
protected $__map_type = self::SCHEMA;
protected $__map_schema = 'public';
protected $__map_identity = 'id = :id';
}
class PersonMap extends PublicMap
{
protected $__map_type = self::RECORD;
protected $__map_name = 'person';
protected $__map_class = Person::class;
}
class Person extends PersonMap
{
public $id = self::AUTOMATIC;
public $name;
}
$pdo = orm::buildPDO([
'type' => 'pgsql',
'host' => 'localhost',
'port' => 5432,
'name' => 'mydb',
'user' => 'me',
'pass' => 'secret'
], true);
$person = new Person(['name' => 'Peter']);
$person->insert();
Inserts a Person record using the defined map classes.
Divengine Studio
Divengine Studio is the platform where these libraries are used as components. It lives at divengine.com and is built from the divengine.github.io repository.
Contributions are welcome: open issues, propose improvements, or submit pull requests on the project repositories.
Mentor and Organizer
Software engineering mentor and organizer of the Divengine open source ecosystem. Author of the libraries featured here, focused on clear reasoning, explicit design, and practical software craft.