Working state
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -24,6 +24,7 @@ public/assets/
|
|||||||
database/*.sqlite
|
database/*.sqlite
|
||||||
database/*.sqlite-shm
|
database/*.sqlite-shm
|
||||||
database/*.sqlite-wal
|
database/*.sqlite-wal
|
||||||
|
database/.provision.lock
|
||||||
|
|
||||||
# ============================================
|
# ============================================
|
||||||
# Cache & Logs
|
# Cache & Logs
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ use App\Shared\Extension\CsrfExtension;
|
|||||||
use App\Shared\Extension\SessionExtension;
|
use App\Shared\Extension\SessionExtension;
|
||||||
use DI\ContainerBuilder;
|
use DI\ContainerBuilder;
|
||||||
use Dotenv\Dotenv;
|
use Dotenv\Dotenv;
|
||||||
|
use Dotenv\Exception\InvalidPathException;
|
||||||
use PDO;
|
use PDO;
|
||||||
use Psr\Container\ContainerInterface;
|
use Psr\Container\ContainerInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
@@ -124,8 +125,22 @@ final class Bootstrap
|
|||||||
|
|
||||||
private function loadEnvironment(): void
|
private function loadEnvironment(): void
|
||||||
{
|
{
|
||||||
$dotenv = Dotenv::createImmutable(__DIR__.'/../..');
|
$rootDir = dirname(__DIR__, 2);
|
||||||
$dotenv->load();
|
$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']);
|
$dotenv->required(['APP_URL', 'ADMIN_USERNAME', 'ADMIN_EMAIL', 'ADMIN_PASSWORD']);
|
||||||
|
|
||||||
date_default_timezone_set($_ENV['TIMEZONE'] ?? 'UTC');
|
date_default_timezone_set($_ENV['TIMEZONE'] ?? 'UTC');
|
||||||
|
|||||||
@@ -128,9 +128,19 @@
|
|||||||
plugins: {
|
plugins: {
|
||||||
upload: {
|
upload: {
|
||||||
serverPath: '/admin/media/upload',
|
serverPath: '/admin/media/upload',
|
||||||
fileFieldName: 'file',
|
fileFieldName: 'image',
|
||||||
urlPropertyName: 'url',
|
urlPropertyName: 'file',
|
||||||
statusPropertyName: 'success'
|
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