Legacy ISO 9001 / ISO 14001 Management Application (2005 → 2026)
Modernization project of a PHP 5.1 application into modern PHP standards.
Core Functionality Modernization (Stage 8) — Stage 8.5 completed on feat/stage-8.5-profiles-empresas-personalizacion.
- Full real legacy menu imported + restructuring patches (0010/0011) — Personalizacion submenu created, Hospitales → Empresas, Permisos moved into Aplicacion, etc.
- Collapsible left sidebar with persisted accordion state (level 2/3 expansions survive navigation) and collapsed-by-default behavior.
- Real modules delivered (GET only):
- Perfiles (full listing + forms)
- Empresas (listing + basic form)
- Menus, Idiomas, Permisos (real pages under Aplicacion — fully navigable)
- Login forms localized.
- Docker now auto-compiles
.mofiles from.poon container start. - All changes follow the menu-driven, incremental modernization approach.
- See
.agents/STAGE-CHECKLISTS.md(Stage 8.5 section) and the PR for full evidence.
- Fully Dockerized environment (PHP 8.3 + nginx + PostgreSQL 16).
- Real database-backed login (company → user) with zero hardcoded shortcuts.
- Incremental data migration system (
docker/db-init/data-patches/) tracked indata_patchestable. - Full real menu hierarchy imported from legacy data (
menu_nuevo+menu_idiomas_nuevo) and rendered as a collapsible top menu on the modern landing page. - Legacy
accionkeys (e.g.medio:aspectos:impactos) are automatically translated to clean Phroute-style paths (/medio/aspectos/impactos). - Smart fallback: unmapped legacy actions land on a friendly page that still shows the full menu (no navigation breakage).
- Gettext fully working (Spanish active) + English translation scaffolding started.
.po→.mofiles are automatically compiled on container start (no manualmsgfmtneeded during development).- All critical flows clean under Xdebug (zero deprecation noise on login → landing → menu).
- Real modules (GET-only) under Administración → Aplicacion: Perfiles (complete), Empresas, Menus, Idiomas, Permisos — all navigable with modern chrome.
- Using the now-functional menu as the driver to populate real content in modules, one area at a time.
- Next major step: POST + validation for the modules delivered in Stage 8.5 (Perfiles, Empresas, etc.).
- Expanding Phroute route coverage for the legacy action keys as modules are modernized.
- The application now has a usable navigation structure based on real historical menu data.
- Most modules are still stubs or lightly modernized. The goal is incremental, menu-driven development.
- Not production ready.
See .agents/MIGRATION-PLAN.md and .agents/STAGE-CHECKLISTS.md for the detailed roadmap and evidence.
All development must be done using Docker. No local PHP, nginx, or PostgreSQL is ever used.
# 1. Start everything
docker compose --env-file .env.docker up -d --build
# 2. Initialize the minimal database schema + seed (required for login)
docker compose exec app ./scripts/init-db.sh
# Note: New reference data (e.g. more menu items) is added via docker/db-init/data-patches/*.sql
# and applied automatically and idempotently by the init script.
# 3. (Optional but recommended during active work) Run tests
docker compose exec app ./vendor/bin/phpunitYou can then open http://localhost:8080/ and use the demo credentials:
- Company:
demo/admin - User:
admin/admin
After successful login you should reach a functional landing page at /main/.
- PHP 8.3 (FPM + CLI) with Xdebug enabled
- Nginx
- PostgreSQL 16
- Full strict Test + Fix Loop discipline expected (Xdebug on, zero tolerance for new warnings in critical paths)
See .agents/DOCKER-ENV.md, .agents/STAGE-CHECKLISTS.md, and .agents/AGENTS.md for detailed commands, validation gates, and working rules.
| Layer | Original (2005-era) | Current (2026) | Notes |
|---|---|---|---|
| PHP | 5.1 | 8.3 | Full Docker (fpm + cli) |
| Database Access | PEAR::DB | PDO + custom query builder | Working, still legacy patterns |
| Authentication | PEAR::Auth | Jasny/Auth v2 + custom two-step flow | Real DB-backed (company → user) |
| Forms | PEAR::QuickForm | Former 5.x (still pulls old Illuminate) | Major upgrade done |
| Routing | Custom / old | Phroute 2.2 | Patches removed |
| Templating | Old PHP / PEAR | Twig 3.x | Upgrade complete |
| Logging | ? | Monolog 2.x | Upgrade complete |
| Frontend | Old HTML + JS | Bootstrap 3 (CDN) + legacy CSS | Still legacy |
| Localization | Manual | gettext | Working |
| Testing | None | PHPUnit 10 | Growing test suite |
| Environment | Direct host PHP | 100% Docker (PHP 8.3 + nginx + PG 16) | Enforced |
- Modernize the codebase while preserving original business logic
- Improve maintainability and security
- Follow a careful, step-by-step approach
- Document the full modernization process
- Do all the changes using agentic workflows
All work must be done inside the Docker environment. This is non-negotiable.
docker compose --env-file .env.docker up -ddocker compose exec app ./scripts/init-db.sh(when needed)- Make changes locally (files are bind-mounted)
- Verify using the project's strict standards:
- Run relevant tests inside the container
- Test critical flows (especially login → main → logout) with Xdebug enabled
- Ensure no new deprecation/warning noise is introduced in the response bodies
- Update documentation in
.agents/when appropriate (doc-first for significant work) - Commit and open a Pull Request
Strong expectations:
- Follow the Test + Fix Loop (root cause fixes, no hiding with error suppression).
- Every meaningful change should be verifiable with clean Xdebug output on the main flows.
- Large dependency or architectural changes are documented in the
.agents/folder.
See .agents/MIGRATION-PLAN.md, .agents/STAGE-CHECKLISTS.md, and .agents/AGENTS.md for the current plan and rules.
Last updated: June 2026 (during Stage 8 composer dependency modernization)
Maintained by laanito + agentic workflow
Note for contributors/agents: The authoritative source of truth for the current state and roadmap is always in the .agents/ directory, not this README.