Webrium Core is a high-performance PHP component library designed to simplify web development. While it serves as the backbone of the Webrium Framework, it is built to be completely standalone — drop it into any PHP project and use only what you need.
It provides routing, controllers, requests/responses, sessions, validation, file uploads, an HTTP client, JWT, hashing, events, filesystem helpers, localization, and a unified error handler — with no required dependencies beyond PHP itself.
composer require webrium/core<?php
require_once __DIR__ . '/vendor/autoload.php';
use Webrium\App;
use Webrium\Route;
App::initialize(__DIR__);
Route::get('/', fn() => "Welcome to Webrium Core! 🚀");
App::run();Then run:
php -S 127.0.0.1:8000 index.phpThe complete documentation for Webrium Core lives at webrium.dev/docs/v5/core. It covers every component the package ships with:
- Routing — defining routes, groups, middleware, named routes, typed parameters
- Controllers — class structure,
boot()/teardown()lifecycle hooks - Requests & Responses — reading input, sending responses, headers, CORS, redirects
- Sessions — sessions, flash messages, validation errors, old input
- Validation — fluent input validation
- File Uploads — secure uploads with safe defaults
- HTTP Client — calling external APIs
- JWT — issuing and verifying signed tokens
- Hashing — passwords, HMACs, tokens, UUIDs
- Events — publish/subscribe system
- Filesystem —
FileandDirectoryutilities - Localization — file-based translations
- Error Handling — unified handling of errors, exceptions, and fatal shutdowns
- Helper Functions — the complete reference of global helpers
The same documentation is also available as plain Markdown in the webrium/docs repository.
Webrium Core is one of four packages that make up the full Webrium Framework:
webrium/core— this packagewebrium/foxdb— query builder, ORM, migrations, seederswebrium/view— Blade-compatible templating engine with hybrid static cachingwebrium/console— thewebriumCLI toolkit
Each is independently usable, except webrium/console which is framework-coupled.
MIT — see LICENSE.