webrium / core
A lightweight set of PHP utility classes for common web tasks: routing, HTTP requests and headers, sessions, validation, file uploads, JWT, and hashing.
Requires
- php: ^8.1
Requires (Dev)
- phpunit/phpunit: ^9.6
This package is auto-updated.
Last update: 2026-06-29 13:51:11 UTC
README
Webrium Core
The Lightweight Engine for Modern PHP Applications
Fast · Modular · Elegant
webrium.dev · Documentation · GitHub
🌟 Overview
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.
🚀 Quick Start
1. Installation
composer require webrium/core
2. Basic Setup (index.php)
<?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.php
📚 Documentation
The 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.
Part of the Webrium Ecosystem
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.
License
Webrium Core is open-sourced software licensed under the MIT license.