Skip to content

Commit b740396

Browse files
Weslley VictorGrahamCampbell
andauthored
Adding safeLoad() information on README.md file (#478)
Co-authored-by: Graham Campbell <[email protected]>
1 parent b3eac5c commit b740396

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@ $dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
9898
$dotenv->load();
9999
```
100100

101+
To suppress the exception that is thrown when there is no `.env` file, you can:
102+
103+
```php
104+
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
105+
$dotenv->safeLoad();
106+
```
107+
101108
Optionally you can pass in a filename as the second parameter, if you would
102109
like to use something other than `.env`:
103110

0 commit comments

Comments
 (0)