vortexphp / framework
Lightweight PHP application stack (app/, engine/, config, assets)
Requires
- php: ^8.2
- ext-mbstring: *
- ext-pdo: *
- twig/twig: ^3.0
Requires (Dev)
- mockery/mockery: ^1.6
- phpunit/phpunit: ^11.0
Suggests
- ext-openssl: SMTP STARTTLS / ssl:// (MAIL_ENCRYPTION tls or ssl)
README
Lightweight PHP application stack: HTTP routing, Twig views, PDO database layer, mail, cache, config, console, events, validation, and i18n.
Install
composer require vortexphp/framework
Requires PHP 8.2+, ext-mbstring, ext-pdo, and Twig 3. For SMTP with TLS/SSL, install ext-openssl (see composer.json suggest).
Project layout
The framework expects a base path (your app root) with at least:
config/— configuration read byVortex\Config\Repositoryconfig/paths.php(optional) — return['migrations' => '…']relative to the project root; default isdb/migrationsapp/Routes/*.php— HTTP route files (required in order; register viaVortex\Routing\Route; optional->name('key')+route('key', $params))app/Routes/*Console.php— console route files (returncallable(ConsoleApplication): void)assets/views/— Twig templates (used byVortex\Application::boot())storage/cache/twig/— optional Twig cache whenapp.debugis false
Quick start
<?php declare(strict_types=1); require __DIR__ . '/vendor/autoload.php'; use Vortex\Application; $app = Application::boot(__DIR__); // loads `.env`, registers core services; optional 2nd arg: ?callable $configure(Container, $basePath) $app->run(); // or use Http\Kernel with global middleware from config
Use the Vortex\ namespace for framework types. See the test suite under tests/ for concrete usage patterns.
Testing HTTP in-process: Kernel::handle(Request::make('GET', '/path')) returns a Response without sending output; register ErrorRenderer on the container when using the full error stack (see tests/KernelHandleTest.php).
Changelog
See CHANGELOG.md.
License
MIT.