Skip to content

Commit 0e88ba1

Browse files
author
Norman Kämper-Leymann
authored
Merge pull request drupal-composer#589 from drupal-composer/dotenv_safeload
Safe-load .env only if exists to prevent fatal error during site install.
2 parents eeea242 + a7dab54 commit 0e88ba1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

load.environment.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66
*/
77

88
use Dotenv\Dotenv;
9-
use Dotenv\Exception\InvalidPathException;
109

1110
/**
1211
* Load any .env file. See /.env.example.
1312
*
14-
* Drupal has no official method for loading environment variables and uses
13+
* Drupal has no official method for loading environment variables and uses
1514
* getenv() in some places.
1615
*/
1716
$dotenv = Dotenv::createUnsafeImmutable(__DIR__);
18-
$dotenv->load();
17+
$dotenv->safeLoad();

0 commit comments

Comments
 (0)