Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

.bootstrap.php 876B

123456789101112131415161718192021
  1. <?php
  2. use Symfony\Component\Dotenv\Dotenv;
  3. require dirname(__DIR__).'/vendor/autoload.php';
  4. if (!array_key_exists('APP_ENV', $_SERVER)) {
  5. $_SERVER['APP_ENV'] = $_ENV['APP_ENV'] ?? null;
  6. }
  7. if ('prod' !== $_SERVER['APP_ENV']) {
  8. if (!class_exists(Dotenv::class)) {
  9. throw new RuntimeException('The "APP_ENV" environment variable is not set to "prod". Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.');
  10. }
  11. (new Dotenv())->loadEnv(dirname(__DIR__).'/.env');
  12. }
  13. $_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $_SERVER['APP_ENV'] ?: $_ENV['APP_ENV'] ?: 'dev';
  14. $_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV'];
  15. $_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], FILTER_VALIDATE_BOOLEAN) ? '1' : '0';