Skip to content

Commit

Permalink
support vlucas/phpdotenv ^2.5 | ^3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Stark committed Aug 12, 2019
1 parent 432ea2e commit e382510
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Runs migrations automatically",
"keywords": ["composer", "development", "craftcms"],
"type": "composer-plugin",
"version": "1.1.0",
"version": "1.2.0",
"license": "MIT",
"autoload": {
"psr-4": {
Expand All @@ -19,7 +19,7 @@
"require": {
"composer-plugin-api": "^1.0",
"craftcms/cms": "^3.0.0",
"vlucas/phpdotenv": "^2.5"
"vlucas/phpdotenv": "^2.5 | ^3.4"
},
"require-dev": {
"composer/composer": "^1.0"
Expand Down
4 changes: 3 additions & 1 deletion src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ protected function bootstrapCraft()

// Load .env
if (file_exists($root . '/.env')) {
$dotenv = new Dotenv($root);
$dotenv = (method_exists('DotEnv\DotEnv', 'create'))
? DotEnv\DotEnv::create($root)
: new Dotenv\Dotenv($root);
$dotenv->load();
}

Expand Down

0 comments on commit e382510

Please sign in to comment.