ctebah / ufw
A compact, highly extensible PHP framework for building robust backend services, platforms, and web portals.
Requires
- php: >=7.4
- ctebah/mimey: ^2
- guzzlehttp/guzzle: ^7.
- laminas/laminas-diactoros: ^2
- laminas/laminas-httphandlerrunner: ^2
- laminas/laminas-stratigility: ^3.
- monolog/monolog: ^2.
- psr/http-message: ^1
- tedivm/jshrink: ^1.8
- willdurand/negotiation: ^3
This package is auto-updated.
Last update: 2026-04-26 13:12:32 UTC
README
μfw is short for micro framework - that is the real name; UFW is the ASCII spelling so nobody has to chase μ on the keyboard. A compact PHP stack for people who still like PHP, and for people who must use it even if they do not love it.
Probably not for you if:
- You have decided PHP is a dead language and nothing written in it should ever run in production.
- You want Express-style routing (
app->get('/foo', …)chains in code). UFW defaults to routes in config and dispatch conventions - patterns can be literal or regex; there is noapp->getfaçade out of the box. - You expect batteries-included auth, ORM, and GraphQL. UFW gives you HTTP plumbing, forms, a MySQL helper, and opinions - you bring the domain.
- You need the framework to natively cover React Server Components, Next.js-shaped routing, tRPC, Bun/Deno, edge/serverless-first deploys, Vite-centric SPAs, or full-stack TypeScript. HTTP here is PHP (Laminas, middleware, server-rendered HTML or JSON); bring a Node BFF if your bingo card requires the rest.
- Your motto is "DI or die": constructor injection everywhere, PSR-11 purity, no singletons, no service locator. UFW is fine with
Registry,Db::instance(), and helpers via__call.
Might be for you if:
- You care that the stack has years behind it: UFW has been running production code for 8+ years, not a throwaway prototype.
- You want to ship - a page, a form, an endpoint - without the framework eating the time you meant to spend on the product.
- You want PSR-7-ish requests/responses, Laminas middleware, and controllers without importing half of Packagist.
- You are fine with convention over endless configuration files, but still want modules, route types, and per-controller middleware.
- You want Zend-style forms and server-side validators so a malicious client cannot bypass checks - UI/UX convenience on the client can still sit on top.
- You like batteries-included defaults but refuse to be locked in: if stock
Record\BaseorController\Baseis wrong for a corner of the app, you replace them in your namespace and move on. - Your template engine (Twig, Blade, whatever) and architecture (MVC, CQRS, DDD, hexagonal, …) are non-negotiable. Swap, extend, or replace views, records, models, and helpers as needed.
Documentation
→ Documentation index - quick taste (~15 min) · full guides (Parts A–D + Next links). The guides stress intent and tradeoffs so you can choose deliberately.
| Guide | What you get |
|---|---|
| Getting started | "Hello world" in about 15 minutes - composer, front controller, one route. |
| Workable demos · ufw-extras | Companion repo: minimal / skeleton / API / i18n / full-CRUD demo apps, plus recipes (assets build, cron, i18n, autoload) and middleware snippets. The fastest way to see UFW in real shape. |
| Evaluation FAQ | Should we use UFW? TL;DR, poor/strong fit, license, hosting. |
| Framework analysis | Honest review: strengths, gaps, recommendations. |
| Bootstrap & registry | Front controller, Application, Registry. |
| Middleware | Pipe, JSON, layout, auth. |
| Responses: multiformat | One action → HTML, JSON, or XHR fragment; Response::registerFormat(). |
| Flavors / multi-app | Env + flavor - app pattern, not core UFW. |
| Security · SECURITY.md | Deployment checklist and vulnerability reporting. |
| Contributing | PR style, scope rules, local checks. |
| Changelog | Full history of releases and changes. |
| License | 0BSD |
Install
composer require ctebah/ufw
Your application still defines APPLICATION_PATH, boots Application, and loads config/app.php - this package is the library, not a turnkey installer. See Getting started for the smallest end-to-end example.
Author
Original author: ctebah · Repository: github.com/ctebah/ufw. If you fork UFW, ship it in a product, or write about it, a mention of the project (and optionally the name above) is appreciated - not required by the license, but it keeps the universe slightly more polite.
License
Zero-Clause BSD (0BSD) - use, change, and redistribute freely for any purpose. The software is provided as-is; the author is not liable for damages arising from its use (standard open-source liability limitation, not a joke license).
SPDX: 0BSD