From ed28e4c8e63f65a78153a5d17e2e34e8878703cb Mon Sep 17 00:00:00 2001 From: Antoine M Date: Wed, 3 Jul 2024 10:32:23 +0200 Subject: [PATCH] Check for existence of vendor directory for better error message replicates https://github.com/symfony/recipes/pull/1301 for the web entry point --- symfony/framework-bundle/7.2/public/index.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/symfony/framework-bundle/7.2/public/index.php b/symfony/framework-bundle/7.2/public/index.php index 9982c218d..9bbd91672 100644 --- a/symfony/framework-bundle/7.2/public/index.php +++ b/symfony/framework-bundle/7.2/public/index.php @@ -2,6 +2,14 @@ use App\Kernel; +if (!is_dir(dirname(__DIR__).'/vendor')) { + throw new LogicException('Dependencies are missing. Try running "composer install".'); +} + +if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) { + throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".'); +} + require_once dirname(__DIR__).'/vendor/autoload_runtime.php'; return function (array $context) {