Auto-deploy: 2026-05-17 01:45:10

This commit is contained in:
Hamza-Ayed
2026-05-17 01:45:10 +03:00
parent 26e0135104
commit 047d9891e9

View File

@@ -24,9 +24,13 @@ use Dompdf\Dompdf;
use Dompdf\Options;
use Dotenv\Dotenv;
// Load .env if it exists
if (file_exists(__DIR__ . '/.env')) {
$dotenv = Dotenv::createImmutable(__DIR__);
// Path to the .env file located outside the document root for security
// Assuming script is in /home/user/htdocs/domain.com/cv/server/
// and .env is in /home/user/
$envPath = realpath(__DIR__ . '/../../../..');
if ($envPath && file_exists($envPath . '/.env')) {
$dotenv = Dotenv::createImmutable($envPath);
$dotenv->load();
}