- Remove require_once for config/config.php (file was never deployed — outside app/) - Inline DB path resolution directly in Database::determineDatabasePath() - Uses APP_ROOT when defined (bootstrap already loaded), falls back to __DIR__/../ - DB_ENV=test|prod env-var override preserved for tests - php -S cli-server -> test.db, nginx/fpm -> posterg.db
3.6 KiB
TODO
-
Replace inline alert CSS in admin.css with floating bottom-center toast styles (fixed, z-index, animation)
-
Update flash-messages.php partial to output
.toastmarkup in hidden container for footer JS -
Add toast container HTML + JS to admin footer.php (centralised, 4s auto-dismiss with fade-out)
-
Remove redundant flash-messages.php includes from all admin pages (8 files)
-
Convert hardcoded alerts in login.php, thanks.php, index.php import to
.toastclass -
Update admin.css dialog rule from
[role=alert/status]to.toast -
Commit with jj
-
Move DB export from admin/index.php to admin/parametres.php (maintenance section)
-
Reorganize src/ - move 7 controllers to src/Controllers/
- Create Controllers directory
- Move controller files (Home, Tfe, Search, ThesisCreate, ThesisEdit, Export, System)
- Update all require_once paths across codebase
-
Move stray test.db from root to storage/
-
Store admin password hash in DB (site_settings) instead of config file
- Create migration 013
- Update AdminAuth to read hash from DB
- Update bootstrap.php — remove credential file loading
- Update parametres.php — status check from DB
- Update actions/account.php — write hash to DB
- Update login.php — dev-mode check
- Update header.php — dev check
- Delete config/admin_credentials.example.php
Now: Single Entry Point Routing
Phase 1: Dispatcher refinement
- MediaController: extract media.php logic into MediaController class
- Create src/Controllers/MediaController.php
- Move path validation + storage jail + MIME check + streaming
- Wire into Dispatcher for /media route
- Delete app/public/media.php
- Update Dispatcher to handle all routes directly (no require APP_ROOT/public/*.php)
Phase 2: Single entry point
-
Create app/public/index.php as front controller
- Move bootstrap logic into entry point (bootstrap.php stays for admin)
- Load and invoke Dispatcher
-
Move old public/*.php views into templates/public/
- search.php → templates/public/search.php
- tfe.php → templates/public/tfe.php
- apropos.php → templates/public/about.php
- repertoire.php → templates/public/repertoire.php
-
Delete old direct-access public/*.php files
- Delete public/index.php (replaced by front controller)
- Delete public/search.php
- Delete public/tfe.php
- Delete public/apropos.php
- Delete public/licence.php
- Delete public/repertoire.php
-
Update Dispatcher.render to use templates/public/ views
-
Update Dispatcher to render full pages (head + header + view + footer) instead of requiring bootstrap
-
Ensure admin/index.php bootstraps its own path (not affected by front controller)
-
Fix config/config.php path mess — inline getDatabasePath() into Database.php, delete config/config.php
Phase 3: Server config
- Update router.php — route all PHP requests to Dispatcher
- Update nginx config — point all public routes to index.php via try_files
- Replace per-file
location ~ \.php$with front-controller pattern
- Replace per-file
- Clean URL updates
- Remove .php from all internal links (header, views, controllers)
- Add clean routes to Dispatcher (/search, /tfe, /media)
- Update og:url tags in controllers to use clean URLs
- Update TfeController redirect to /
- Update header.php action URLs
- Commit current state
- Test all routes (/, /search, /tfe, /repertoire, /apropos, /licence, /media, /live-reload)