-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93b5d5a
commit 0883a06
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# This file is a "template" of which env vars need to be defined for your application | ||
# Copy this file to .env file for development, create environment variables when deploying to production | ||
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration | ||
|
||
###> symfony/framework-bundle ### | ||
APP_ENV=dev | ||
APP_SECRET=94e0ae4ca2770425e020e9703e38b48c | ||
#TRUSTED_PROXIES=127.0.0.1,127.0.0.2 | ||
#TRUSTED_HOSTS=localhost,example.com | ||
###< symfony/framework-bundle ### | ||
|
||
APP_GENERATION_LIMIT=100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
use Symfony\Component\Dotenv\Dotenv; | ||
|
||
require dirname(__DIR__).'/vendor/autoload.php'; | ||
|
||
// 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')) { | ||
$_SERVER += $env; | ||
$_ENV += $env; | ||
} elseif (!class_exists(Dotenv::class)) { | ||
throw new RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.'); | ||
} else { | ||
// load all the .env files | ||
(new Dotenv())->loadEnv(dirname(__DIR__).'/.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'; |