diff --git a/config/config.php b/config/config.php index 0971b05..2c6b447 100644 --- a/config/config.php +++ b/config/config.php @@ -20,6 +20,12 @@ if (!$_ENV['APP_URL']) { // Normalise: toujours un trailing slash unique define('APP_URL', rtrim($_ENV['APP_URL'], '/') . '/'); +if (!defined('DATA_PATH')) { + $__dp = $_ENV['DATA_PATH'] ?? getenv('DATA_PATH') ?: ''; + define('DATA_PATH', $__dp !== '' ? rtrim($__dp, '/') : BASE_PATH . '/data'); + unset($__dp); +} + // (Optionnel) Expose dans $_ENV si besoin $_ENV['APP_URL'] = APP_URL; diff --git a/public/file.php b/public/file.php index b9b947a..7132653 100644 --- a/public/file.php +++ b/public/file.php @@ -4,6 +4,9 @@ declare(strict_types=1); define('BASE_PATH', realpath(__DIR__ . '/../')); +require_once BASE_PATH . '/vendor/autoload.php'; +require_once BASE_PATH . '/config/config.php'; + $uuid = $_GET['uuid'] ?? ''; $name = $_GET['name'] ?? '';