diff --git a/TODO.md b/TODO.md index 51647cb..cb40aa5 100644 --- a/TODO.md +++ b/TODO.md @@ -165,6 +165,7 @@ - [x] Add ZipArchive guard to legacy export-files.php - [x] Refactor deploy recipe: split into deploy-code / deploy-deps / deploy-migrate; deploy-deps patches classmap path (app/src/ → src/) for flat server layout before running composer install; only runs install when lockfile checksum changed +- [x] Fix bootstrap.php autoload path: detect vendor/ location (same dir vs parent dir) to work on both flat server layout and nested local dev layout - [x] Cleanup modal: list files that will be removed (not just counts) - [x] Storage restructure: documents/ → {objet}/ (tfe/theses/frart) diff --git a/app/bootstrap.php b/app/bootstrap.php index d4d818a..016b2bd 100644 --- a/app/bootstrap.php +++ b/app/bootstrap.php @@ -4,8 +4,11 @@ * Simple configuration for website */ -// Composer autoloader -require_once __DIR__ . '/../vendor/autoload.php'; +// Composer autoloader (vendor/ may be sibling dir in dev or same dir in prod) +$autoloadPath = file_exists(__DIR__ . '/vendor/autoload.php') + ? __DIR__ . '/vendor/autoload.php' + : __DIR__ . '/../vendor/autoload.php'; +require_once $autoloadPath; // Define application root define('APP_ROOT', __DIR__);