Auto-deploy: 2026-05-17 01:45:10
This commit is contained in:
@@ -24,9 +24,13 @@ use Dompdf\Dompdf;
|
|||||||
use Dompdf\Options;
|
use Dompdf\Options;
|
||||||
use Dotenv\Dotenv;
|
use Dotenv\Dotenv;
|
||||||
|
|
||||||
// Load .env if it exists
|
// Path to the .env file located outside the document root for security
|
||||||
if (file_exists(__DIR__ . '/.env')) {
|
// Assuming script is in /home/user/htdocs/domain.com/cv/server/
|
||||||
$dotenv = Dotenv::createImmutable(__DIR__);
|
// and .env is in /home/user/
|
||||||
|
$envPath = realpath(__DIR__ . '/../../../..');
|
||||||
|
|
||||||
|
if ($envPath && file_exists($envPath . '/.env')) {
|
||||||
|
$dotenv = Dotenv::createImmutable($envPath);
|
||||||
$dotenv->load();
|
$dotenv->load();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user