From 40f32a8397012788f1382dc465bb4124732552b6 Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Thu, 27 Jun 2024 12:18:04 -0600 Subject: [PATCH] Bring WPCM in line with Bedrock v1.24.x (#134) * use `Dotenv::createImmutable()` see https://github.com/roots/bedrock/pull/714 * Remove post install .env copy see https://github.com/roots/bedrock/pull/595 * inline comments end in full stops --- composer.json | 3 --- config/application.php | 5 ++++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 334a7556..db1d78e2 100644 --- a/composer.json +++ b/composer.json @@ -111,9 +111,6 @@ ] }, "scripts": { - "post-root-package-install": [ - "php -r \"copy('.env.example', '.env');\"" - ], "post-install-cmd": "@maybe-create-symlinks", "pre-update-cmd": [ "WordPressComposerManaged\\ComposerScripts::preUpdate" diff --git a/config/application.php b/config/application.php index 58db64bb..811cd747 100644 --- a/config/application.php +++ b/config/application.php @@ -10,6 +10,9 @@ use Roots\WPConfig\Config; use function Env\env; +// USE_ENV_ARRAY + CONVERT_* + STRIP_QUOTES. +Env\Env::$options = 31; + /** * Directory containing all of the site's files * @@ -32,7 +35,7 @@ ? [ '.env', '.env.pantheon', '.env.local' ] : [ '.env', '.env.pantheon' ]; -$dotenv = Dotenv\Dotenv::createUnsafeImmutable( $root_dir, $env_files, false ); +$dotenv = Dotenv\Dotenv::createImmutable( $root_dir, $env_files, false ); if ( // Check if a .env file exists. file_exists( $root_dir . '/.env' ) ||