From e60aed178b21e1ca91fed5fd8ced1a0730d14d89 Mon Sep 17 00:00:00 2001 From: Jonathan Champ Date: Fri, 18 Nov 2016 15:21:28 -0500 Subject: [PATCH] Dotenv: Unused Loader instance in __construct loadData() will always create a Loader instance, so creating one in Dotenv::__construct() is only useful because it is currently required for Validate to work before calling load() on a real file. --- src/Dotenv.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Dotenv.php b/src/Dotenv.php index e77802f5..b99ec912 100644 --- a/src/Dotenv.php +++ b/src/Dotenv.php @@ -35,7 +35,9 @@ class Dotenv public function __construct($path, $file = '.env') { $this->filePath = $this->getFilePath($path, $file); - $this->loader = new Loader($this->filePath, true); + + // This loader is only a placeholder so that Validate can work. + $this->loader = new Loader(''); } /**