PHP application skeleton: Composer, autoloading, routing, DI #7

Closed
opened 2026-10-10 22:18:18 +00:00 by keith · 2 comments
Owner

Stand up the minimal application structure all features build on.

Scope

  • Composer project with PSR-4 autoloading
  • Front controller in public/index.php
  • HTTP routing with route definitions separated from handlers
  • Dependency container wiring for services and repositories
  • Error handling that renders a readable page in dev and a generic page in production

Acceptance criteria

  • A hello route resolves through the router and renders via a view
  • Services resolve from the container rather than being constructed inline
  • Uncaught exceptions produce a non-leaking error page in production mode

Blocked by: #6

Implementation gate: choose and document maintained routing/container dependencies and PHP versions before coding; no framework is currently installed. Add development test tooling early, not only at release.

Stand up the minimal application structure all features build on. ## Scope - Composer project with PSR-4 autoloading - Front controller in `public/index.php` - HTTP routing with route definitions separated from handlers - Dependency container wiring for services and repositories - Error handling that renders a readable page in dev and a generic page in production ## Acceptance criteria - [ ] A hello route resolves through the router and renders via a view - [ ] Services resolve from the container rather than being constructed inline - [ ] Uncaught exceptions produce a non-leaking error page in production mode --- Blocked by: #6 Implementation gate: choose and document maintained routing/container dependencies and PHP versions before coding; no framework is currently installed. Add development test tooling early, not only at release.
keith added this to the M1 - Docker & Dev Environment milestone 2026-10-10 22:18:18 +00:00
keith added the area:backendtype:chorepriority:high labels 2026-10-10 22:18:18 +00:00
Author
Owner

Task 1 pre-code dependency decision (2026-10-11): retain PHP 8.3 compatibility and test php:8.3-fpm-bookworm (security support through 2027-12-31). Planned later-task constraints: slim/slim ^4.15.3, slim/psr7 ^1.8 (official PSR-7 adapter, PHP ^8.0), php-di/php-di ^7.1 (PHP >=8.0), monolog/monolog ^3.12 (PHP >=8.1), phpunit/phpunit ^12 (PHP >=8.3, bugfix support through 2027-02-05). Slim 4 recommends PHP-DI and supports this PSR-7 adapter. No dependencies installed in Task 1; Composer resolution, audit and lock updates remain later-task gates. Images: postgres:17-bookworm (supported through 2029-11-08), nginx:1.30-alpine (current stable branch), node:24-bookworm-slim (LTS, preferred over older default Node22). Versioned moving patch tags allow security refresh; capture actual runtime versions/digests in verification, not immutable reproducibility claims. Sources checked: https://www.php.net/supported-versions.php https://www.postgresql.org/support/versioning/ https://nodejs.org/en/about/previous-releases https://nginx.org/en/download.html https://packagist.org/packages/slim/slim https://packagist.org/packages/slim/psr7 https://packagist.org/packages/php-di/php-di https://packagist.org/packages/monolog/monolog https://phpunit.de/supported-versions.html . Slim4/PHP-DI/Monolog/PHPUnit are owner-approved. Task1 is a temporary PHP page, not completion of #7.

Task 1 pre-code dependency decision (2026-10-11): retain PHP 8.3 compatibility and test php:8.3-fpm-bookworm (security support through 2027-12-31). Planned later-task constraints: slim/slim ^4.15.3, slim/psr7 ^1.8 (official PSR-7 adapter, PHP ^8.0), php-di/php-di ^7.1 (PHP >=8.0), monolog/monolog ^3.12 (PHP >=8.1), phpunit/phpunit ^12 (PHP >=8.3, bugfix support through 2027-02-05). Slim 4 recommends PHP-DI and supports this PSR-7 adapter. No dependencies installed in Task 1; Composer resolution, audit and lock updates remain later-task gates. Images: postgres:17-bookworm (supported through 2029-11-08), nginx:1.30-alpine (current stable branch), node:24-bookworm-slim (LTS, preferred over older default Node22). Versioned moving patch tags allow security refresh; capture actual runtime versions/digests in verification, not immutable reproducibility claims. Sources checked: https://www.php.net/supported-versions.php https://www.postgresql.org/support/versioning/ https://nodejs.org/en/about/previous-releases https://nginx.org/en/download.html https://packagist.org/packages/slim/slim https://packagist.org/packages/slim/psr7 https://packagist.org/packages/php-di/php-di https://packagist.org/packages/monolog/monolog https://phpunit.de/supported-versions.html . Slim4/PHP-DI/Monolog/PHPUnit are owner-approved. Task1 is a temporary PHP page, not completion of #7.
Author
Owner

Acceptance reconciliation at c1ef2ee: PSR-4/Composer, Slim routing, PHP-DI and production-safe error handling are implemented. AppTest covers container resolution and production/development errors; historical M1 reports cover dependency review and runtime error fixture. Fresh full suite: 291 tests, 1801 assertions, 22 skips; lint passes. Closing this foundation issue only.

Acceptance reconciliation at c1ef2ee: PSR-4/Composer, Slim routing, PHP-DI and production-safe error handling are implemented. AppTest covers container resolution and production/development errors; historical M1 reports cover dependency review and runtime error fixture. Fresh full suite: 291 tests, 1801 assertions, 22 skips; lint passes. Closing this foundation issue only.
keith closed this issue 2026-10-12 18:54:36 +00:00
Sign in to join this conversation.