-
-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
47791de
commit 6dcd202
Showing
3 changed files
with
17 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
* @author Sebastian Feldmann <[email protected]> | ||
* @copyright Sebastian Feldmann <[email protected]> | ||
* @license https://opensource.org/licenses/MIT The MIT License (MIT) | ||
* @link http://phpbu.de/ | ||
* @link https://phpbu.de/ | ||
* @since Class available since Release 4.0.0 | ||
*/ | ||
class Dotenv implements Adapter | ||
|
@@ -41,9 +41,15 @@ class Dotenv implements Adapter | |
*/ | ||
public function setup(array $conf) | ||
{ | ||
$path = AppUtil\Arr::getValue($conf, 'file', '.env'); | ||
$this->file = AppUtil\Path::toAbsolutePath($path, Configuration::getWorkingDirectory()); | ||
$this->dotenv = new DotenvLib(dirname($this->file), basename($this->file)); | ||
$path = AppUtil\Arr::getValue($conf, 'file', '.env'); | ||
$this->file = AppUtil\Path::toAbsolutePath($path, Configuration::getWorkingDirectory()); | ||
|
||
if (method_exists(DotenvLib::class, 'create')) { | ||
$this->dotenv = DotenvLib::create(dirname($this->file), basename($this->file)); | ||
} else { | ||
$this->dotenv = new DotenvLib(dirname($this->file), basename($this->file)); | ||
} | ||
|
||
$this->dotenv->load(); | ||
} | ||
|
||
|