Working state
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -24,6 +24,7 @@ public/assets/
|
||||
database/*.sqlite
|
||||
database/*.sqlite-shm
|
||||
database/*.sqlite-wal
|
||||
database/.provision.lock
|
||||
|
||||
# ============================================
|
||||
# Cache & Logs
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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') }}'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user