From d074da51ee3e10ff2de52a18ad1a7a3f52ea4d1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Ignacio=20Torres?= Date: Fri, 15 May 2026 23:27:51 -0700 Subject: [PATCH] fix: don't break if there's no .env file present --- public/index.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/public/index.php b/public/index.php index d8e0614..a0a2eca 100644 --- a/public/index.php +++ b/public/index.php @@ -13,8 +13,11 @@ use Slim\Factory\ServerRequestCreatorFactory; require __DIR__ . '/../vendor/autoload.php'; // Loading environment variables from .env file, if it exists -$dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . '/../'); -$dotenv->safeLoad(); +$envPath = __DIR__ . '/../.env'; +if (is_file($envPath)) { + $dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . '/../'); + $dotenv->safeLoad(); +} // Instantiate PHP-DI ContainerBuilder $containerBuilder = new ContainerBuilder(); -- 2.51.2