mirror of
				https://gitlab.com/Chill-Projet/chill-bundles.git
				synced 2025-11-04 11:18:25 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			33 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
declare(strict_types=1);
 | 
						|
 | 
						|
/*
 | 
						|
 * Chill is a software for social workers
 | 
						|
 *
 | 
						|
 * For the full copyright and license information, please view
 | 
						|
 * the LICENSE file that was distributed with this source code.
 | 
						|
 */
 | 
						|
 | 
						|
use Symfony\Component\Dotenv\Dotenv;
 | 
						|
 | 
						|
require dirname(__DIR__).'/../../vendor/autoload.php';
 | 
						|
 | 
						|
if (!class_exists(Dotenv::class)) {
 | 
						|
    throw new LogicException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.');
 | 
						|
}
 | 
						|
 | 
						|
// Load cached env vars if the .env.local.php file exists
 | 
						|
// Run "composer dump-env prod" to create it (requires symfony/flex >=1.2)
 | 
						|
if (is_array($env = @include dirname(__DIR__).'/.env.local.php') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) {
 | 
						|
    (new Dotenv(false))->populate($env);
 | 
						|
} else {
 | 
						|
    // load all the .env files
 | 
						|
    (new Dotenv(false))->loadEnv(dirname(__DIR__).'/../../.env.test');
 | 
						|
}
 | 
						|
 | 
						|
$_SERVER += $_ENV;
 | 
						|
$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev';
 | 
						|
$_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV'];
 | 
						|
$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], FILTER_VALIDATE_BOOLEAN) ? '1' : '0';
 |