feat(core): PHP MVC skeleton from scratch (autoloader/router/PDO + tests + CI) #9

Merged
Corentin merged 3 commits from feat/p2-core-php into dev 2026-06-15 16:24:46 +02:00
Owner

Squelette applicatif PHP from-scratch (POO MVC, sans framework, sans Composer, autoloader PSR-4 manuel, PDO prepared statements).

Core (src/Core/) : Autoloader (namespace App\ -> src/), Config (getenv), Database (PDO, ERRMODE_EXCEPTION, EMULATE_PREPARES=false, lazy connect), Request, Response, Router ({param} + 404/405), Controller (base, heritage Cr 4.c.1).
Controllers : HealthController (GET /api/health -> JSON + COUNT(*) FROM category reel), HomeController (GET / -> vue). Front controller src/public/admin/index.php (remplace le stub).
Tooling sans Composer : PHPUnit (.phar) + tests Router/Config, phpstan.neon (niveau 6), job CI static-tests bascule en mode .phar (phpunit/phpstan epingles).

Verifie : php -l OK, PHPUnit 23 tests / 30 assertions OK, PHPStan niveau 6 -> 0 erreur, endpoint live /api/health -> {status:ok, db:ok, categories:9}, / -> 200, /api/nope -> 404, revue securite 7/7 (PDO prepared, strict_types, htmlspecialchars, pas de fuite, headers nosniff/noindex).

Namespace App\ conforme PROJECT_CONTEXT section 9 (decision validee).
Differe : auth (sessions + argon2id) + RBAC -> PR suivante.

Pour fusionner : label auto-merge (sinon relecture). Base : dev. Bloc 2 (Cr 4.c POO/heritage/namespaces, Cr 4.e anti-injection).

Squelette applicatif PHP from-scratch (POO MVC, sans framework, sans Composer, autoloader PSR-4 manuel, PDO prepared statements). Core (src/Core/) : Autoloader (namespace App\ -> src/), Config (getenv), Database (PDO, ERRMODE_EXCEPTION, EMULATE_PREPARES=false, lazy connect), Request, Response, Router ({param} + 404/405), Controller (base, heritage Cr 4.c.1). Controllers : HealthController (GET /api/health -> JSON + COUNT(*) FROM category reel), HomeController (GET / -> vue). Front controller src/public/admin/index.php (remplace le stub). Tooling sans Composer : PHPUnit (.phar) + tests Router/Config, phpstan.neon (niveau 6), job CI static-tests bascule en mode .phar (phpunit/phpstan epingles). Verifie : php -l OK, PHPUnit 23 tests / 30 assertions OK, PHPStan niveau 6 -> 0 erreur, endpoint live /api/health -> {status:ok, db:ok, categories:9}, / -> 200, /api/nope -> 404, revue securite 7/7 (PDO prepared, strict_types, htmlspecialchars, pas de fuite, headers nosniff/noindex). Namespace App\ conforme PROJECT_CONTEXT section 9 (decision validee). Differe : auth (sessions + argon2id) + RBAC -> PR suivante. Pour fusionner : label auto-merge (sinon relecture). Base : dev. Bloc 2 (Cr 4.c POO/heritage/namespaces, Cr 4.e anti-injection).
Corentin added 2 commits 2026-06-15 16:14:14 +02:00
Merge remote-tracking branch 'forgejo/dev' into feat/p2-core-php
Some checks failed
CI / static-tests (pull_request) Failing after 35s
CI / secret-scan (pull_request) Successful in 11s
CI / php-lint (pull_request) Successful in 26s
CI / secret-scan (push) Successful in 13s
CI / php-lint (push) Successful in 26s
CI / static-tests (push) Failing after 31s
CI / auto-merge (pull_request) Has been skipped
CI / auto-merge (push) Has been skipped
e265b0cb92
Corentin added 1 commit 2026-06-15 16:18:14 +02:00
ci: install php-xml/php-mbstring for phpunit/phpstan (bookworm php-cli lacks dom/mbstring/xml)
All checks were successful
CI / php-lint (push) Successful in 23s
CI / static-tests (push) Successful in 41s
CI / secret-scan (pull_request) Successful in 13s
CI / secret-scan (push) Successful in 9s
CI / php-lint (pull_request) Successful in 27s
CI / static-tests (pull_request) Successful in 37s
CI / auto-merge (push) Has been skipped
CI / auto-merge (pull_request) Has been skipped
56d0b941e8
Corentin merged commit 93a6b8e292 into dev 2026-06-15 16:24:46 +02:00
Corentin deleted branch feat/p2-core-php 2026-06-15 16:24:46 +02:00
Sign in to join this conversation.
No reviewers
No labels
auto-merge
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: AcadeNice/corentin_wakdo#9
No description provided.