Skip to content

Repository files navigation

DLTN Framework

Bare-bones PHP mini-framework with an admin shell and WordPress-style hooks.

Requirements

  • PHP 8.1+
  • Database: MySQL 5.7+ / MariaDB 10.3+ or SQLite 3 (choose one at install / in .env)
  • Extensions: pdo_mysql and/or pdo_sqlite (for the driver you use), plus sodium, openssl, mbstring, curl, json
  • Apache (or Nginx) with document root pointed at public/

Quick start

  1. Copy this project to your server (or clone locally).
  2. Run composer install if core/vendor is missing.
  3. Point the web server document root at public/.
  4. Visit the site → installer at /install/ (writes .env), or copy .env.example.env by hand.
  5. Create the admin account (2FA is available later under Account).
  6. Sign in at /admin/login.

Public home page: Welcome to DLTN Framework.

Layout

public/           # web root (index.php)
core/             # framework (PHP, templates, assets, migrations)
content/          # operator zone (extensions, uploads, cache, avatars)
config/           # committed PHP config (reads env())
.env              # secrets (generated by installer; not in git)
.env.example
docs/             # architecture + hooks + extending guides
AGENTS.md         # entrypoint for AI coding agents

Configuration

Laravel-style hybrid:

  • .env — secrets and environment-specific values (APP_KEY, DB_, SMTP_, …)
  • config/*.php — structure and defaults; call env('KEY', default)

Database (config/database.php):

  • DB_CONNECTIONmysql or sqlite
  • DB_HOST / DB_PORT / DB_DATABASE / DB_USERNAME / DB_PASSWORD (MySQL)
  • For SQLite, set DB_CONNECTION=sqlite and DB_DATABASE to an absolute path under content/database/

App name and SMTP live in .env / config/ (not admin UI):

  • APP_NAME
  • SMTP_* (host, port, username, password, encryption, from address/name)

Extending

Drop a folder in content/extensions/{slug}/ with a bootstrap file and headers:

<?php
/**
 * Extension Name: Hello
 * Description: Demo sidebar link.
 * Version: 1.0.0
 */

add_filter('admin_menu', function (array $nav): array {
    $nav[] = [
        'link' => [
            'href'  => '/admin/hello',
            'label' => 'Hello',
            'cap'   => 'view_dashboard',
            'icon'  => 'hand', // Lucide icon name
        ],
    ];
    return $nav;
});

Keep templates, PHP (src/Dltn\Ext\{Studly}\), assets (/ext/{slug}/...), and database migrations inside that folder. After adding schema, run php bin/migrate.php. Full recipes: docs/EXTENDING.md. Hook catalog: docs/HOOKS.md.

CLI

php bin/migrate.php          # apply pending migrations
php bin/cron.php             # cron hook + queue drain + rate-limit prune
php bin/queue.php            # process jobs only
composer test                # PHPUnit

Nginx sample: docs/nginx.conf.example.

Docs for AI agents

Start at AGENTS.md, then:

Doc Contents
docs/ARCHITECTURE.md Request lifecycle, directories, container, schema
docs/HOOKS.md Every action/filter, args, call sites
docs/EXTENDING.md Add admin pages, routes, mail, migrations
docs/CONVENTIONS.md Naming, where code belongs, templates

License

MIT © Dalton Sutton.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages