From 7c10b647a3276cef68d9c2b6f188f9966396a711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 10 May 2020 17:02:09 +0200 Subject: [PATCH] Updated some recipes. --- bin/console | 6 +++--- config/bootstrap.php | 12 ++++++------ public/.htaccess | 2 +- symfony.lock | 10 +++++----- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/bin/console b/bin/console index 5d5c80fb..5de0e1c5 100755 --- a/bin/console +++ b/bin/console @@ -6,8 +6,8 @@ use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Input\ArgvInput; use Symfony\Component\ErrorHandler\Debug; -if (false === in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) { - echo 'Warning: The console should be invoked via the CLI version of PHP, not the '.\PHP_SAPI.' SAPI'.\PHP_EOL; +if (!in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) { + echo 'Warning: The console should be invoked via the CLI version of PHP, not the '.PHP_SAPI.' SAPI'.PHP_EOL; } set_time_limit(0); @@ -15,7 +15,7 @@ set_time_limit(0); require dirname(__DIR__).'/vendor/autoload.php'; if (!class_exists(Application::class)) { - throw new RuntimeException('You need to add "symfony/framework-bundle" as a Composer dependency.'); + throw new LogicException('You need to add "symfony/framework-bundle" as a Composer dependency.'); } $input = new ArgvInput(); diff --git a/config/bootstrap.php b/config/bootstrap.php index 976a7763..55560fb8 100644 --- a/config/bootstrap.php +++ b/config/bootstrap.php @@ -4,14 +4,14 @@ 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') && ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV']) { - foreach ($env as $k => $v) { - $_ENV[$k] = $_ENV[$k] ?? (isset($_SERVER[$k]) && 0 !== strpos($k, 'HTTP_') ? $_SERVER[$k] : $v); - } -} elseif (!class_exists(Dotenv::class)) { - throw new RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.'); +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'); diff --git a/public/.htaccess b/public/.htaccess index 0379bfca..2776637c 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -9,7 +9,7 @@ DirectoryIndex index.php # feature in your server configuration. Uncomment the following line if you # install assets as symlinks or if you experience problems related to symlinks # when compiling LESS/Sass/CoffeScript assets. -# Options FollowSymlinks +# Options +FollowSymlinks # Disabling MultiViews prevents unwanted negotiation, e.g. "/index" should not resolve # to the front controller "/index.php" but be rewritten to "/index.php/index". diff --git a/symfony.lock b/symfony.lock index 96878316..e9e0b067 100644 --- a/symfony.lock +++ b/symfony.lock @@ -296,12 +296,12 @@ "version": "1.7.1" }, "php-translation/symfony-bundle": { - "version": "0.4", + "version": "0.10", "recipe": { "repo": "github.com/symfony/recipes-contrib", "branch": "master", - "version": "0.4", - "ref": "ee15ad002114fba7b694a7fe429419b518d43bc4" + "version": "0.10", + "ref": "7626dc2639039d9db29789b560171f2f2a9d8468" }, "files": [ "./config/packages/dev/php_translation.yaml", @@ -446,7 +446,7 @@ "repo": "github.com/symfony/recipes-contrib", "branch": "master", "version": "1.0", - "ref": "410b9325a37ef86f1e47262c61738f6202202bca" + "ref": "71599f5b0fdeeeec0fb90e9b17c85e6f5e1350c1" }, "files": [ "./public/.htaccess" @@ -473,7 +473,7 @@ "repo": "github.com/symfony/recipes", "branch": "master", "version": "4.4", - "ref": "fead3ab2e80622c61d13dac0d21a3430a45efae8" + "ref": "ea8c0eda34fda57e7d5cd8cbd889e2a387e3472c" }, "files": [ "./bin/console",