A small PHP MVC framework from 2012, modernized to run cleanly on PHP 8.
Front-controller routing, models, sessions and form validation — no framework magic to fight, just the moving parts you'd build yourself. Not a production-hardened toolkit (see Known limitations).
- Front-controller routing (
/application/controller/method/param) - A small
Modelbase class with basic query building and validation hooks - Session-based auth (
SessionMan,Application::checkAuth()) - A
Form/Validatorpair for per-field validation rules - A working example module (
usuario): login, list, create, edit, delete - PostgreSQL support out of the box, with a Docker Compose setup for local dev
- PHP >= 8.2 with the
pgsqlandpdo_pgsqlextensions - PostgreSQL >= 13
- Composer (for running the test suite)
- Docker + Docker Compose (optional, for the one-command quick start)
docker compose up --build
Then open http://localhost:8080 and log in with:
- User:
admin - Password:
admin123
Change or remove that seed account before exposing this anywhere public — see
abbys.sql. This spins up the app on PHP 8.2 + Apache and a PostgreSQL
database seeded from abbys.sql (the grupo/usuario tables plus that one
admin account). Data persists in a Docker volume across restarts; run
docker compose down -v to wipe it and start fresh.
-
Point an Apache vhost (with
mod_rewriteandAllowOverride All) at the repository root, or run PHP's built-in server:php -S localhost:8080 -
Create a PostgreSQL database and load the schema:
createdb abbys psql abbys < abbys.sql -
Set connection details via environment variables (defaults shown):
Variable Default DB_HOSTlocalhostDB_USERpostgresDB_PASSWDpostgresDB_DATABASEabbysThese are read in
system/config/settings.dev.php. -
Visit the site and log in with the seed admin account from
abbys.sql(see Quick start above).
application/<app>/<controller>/{controller,model,view}/ # your modules go here
system/ # framework core
routing/router.php # URL -> application/controller/method/var
db/model.php # base Model class
db/validator.php # Form + Validator
sessionman.php # session helpers
base.php # Application front controller
tests/ # PHPUnit suite for the framework core
composer install
composer test
The suite covers the framework core (routing, validation, models, sessions,
HTTP handling) with plain PHPUnit tests — no database required. See
TEST_COVERAGE_ANALYSIS.md for the original coverage audit.
This is a 2012-era learning framework modernized to run on PHP 8, not a hardened one:
Model::prepareStatement()builds queries by string substitution (escaped withaddslashes()), not real parameterized queries/PDO bindings.- Only the
usuario(login/CRUD) module ships as a working example; it's a good reference for building your own modules on top ofApplication/Model/Router.
See CONTRIBUTING.md.
MIT — see LICENSE.