add auto load .env

This commit is contained in:
2026-09-10 13:53:20 +02:00
parent d6cb4078bc
commit 9016fb7baf
13 changed files with 532 additions and 28 deletions
+6 -2
View File
@@ -1,4 +1,8 @@
<?php
include_once './connection.php';
include_once './user.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/vendor/autoload.php';
$dotenv = Dotenv\Dotenv::createImmutable($_SERVER['DOCUMENT_ROOT']); // dir containing .env
$dotenv->load();
require_once $_SERVER['DOCUMENT_ROOT'] . '/php/auto/connection.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/php/auto/user.php';