From bc04dfca0f1ac75e67ed379fa7dded67e3f76e45 Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Tue, 10 Feb 2026 12:24:06 -0800 Subject: [PATCH] feat: Generate a helpful web page if missing composer If `composer install` has not been setup yet, causing `vendor/autoload.php` to not be created, generate a helpful error message on the web page. Before the server would just generate a 500 message with no details. --- Pages/Page.php | 6 +- Web/Services/index.php | 3 + lib/ComposerDependenciesGuard.php | 96 +++++++++++++++++++++++++++++++ 3 files changed, 101 insertions(+), 4 deletions(-) create mode 100644 lib/ComposerDependenciesGuard.php diff --git a/Pages/Page.php b/Pages/Page.php index 6ad595167..24dc691a4 100644 --- a/Pages/Page.php +++ b/Pages/Page.php @@ -1,9 +1,7 @@ 'dependencies_missing', + 'message' => 'Application dependencies are not installed. Run "composer install" in the project root.', + ], + JSON_UNESCAPED_SLASHES + ); + exit; + } + + if (!headers_sent()) { + header('Content-Type: text/html; charset=utf-8', true, 503); + } + + echo <<<'HTML' + + + + + + LibreBooking Setup Required + + + +
+

Application setup is incomplete

+

Composer dependencies are missing, so LibreBooking cannot start yet.

+

From the project root, run composer install, then reload this page.

+
+ + +HTML; + + exit; +}