Working state

This commit is contained in:
julien
2026-03-16 12:01:10 +01:00
parent 8e59daa4cd
commit dec76fa2c7
3 changed files with 31 additions and 5 deletions

1
.gitignore vendored
View File

@@ -24,6 +24,7 @@ public/assets/
database/*.sqlite
database/*.sqlite-shm
database/*.sqlite-wal
database/.provision.lock
# ============================================
# Cache & Logs

View File

@@ -11,6 +11,7 @@ use App\Shared\Extension\CsrfExtension;
use App\Shared\Extension\SessionExtension;
use DI\ContainerBuilder;
use Dotenv\Dotenv;
use Dotenv\Exception\InvalidPathException;
use PDO;
use Psr\Container\ContainerInterface;
use Psr\Http\Message\ResponseInterface;
@@ -124,8 +125,22 @@ final class Bootstrap
private function loadEnvironment(): void
{
$dotenv = Dotenv::createImmutable(__DIR__.'/../..');
$dotenv->load();
$rootDir = dirname(__DIR__, 2);
$envPath = $rootDir . '/.env';
try {
$dotenv = Dotenv::createImmutable($rootDir);
$dotenv->load();
} catch (InvalidPathException $exception) {
throw new \RuntimeException(
sprintf(
"Fichier .env introuvable a la racine du projet (%s). Copiez .env.example vers .env avant de demarrer l'application.",
$envPath
),
previous: $exception,
);
}
$dotenv->required(['APP_URL', 'ADMIN_USERNAME', 'ADMIN_EMAIL', 'ADMIN_PASSWORD']);
date_default_timezone_set($_ENV['TIMEZONE'] ?? 'UTC');

View File

@@ -128,9 +128,19 @@
plugins: {
upload: {
serverPath: '/admin/media/upload',
fileFieldName: 'file',
urlPropertyName: 'url',
statusPropertyName: 'success'
fileFieldName: 'image',
urlPropertyName: 'file',
statusPropertyName: 'success',
data: [
{
name: '{{ csrf.keys.name|e('js') }}',
value: '{{ csrf.name|e('js') }}'
},
{
name: '{{ csrf.keys.value|e('js') }}',
value: '{{ csrf.value|e('js') }}'
}
]
}
}
});