Skip to content

Commit

Permalink
fix(src/Manager): fix load .env 🐛
Browse files Browse the repository at this point in the history
  • Loading branch information
TIGERB committed Mar 23, 2019
1 parent d27f8c0 commit 83f7069
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public function welcome()
An object-oriented multi process manager for PHP
Version: 0.3.5
Version: 0.5.0
\033[0m
WELCOME;
Expand All @@ -205,7 +205,17 @@ public function welcome()
*/
private function loadEnv()
{
$this->env = parse_ini_file(__DIR__ . '/../.env', true);
$envPath = __DIR__ . '/../';
if (!file_exists($envPath . '.env')) {
copy($envPath . '.env.example', $envPath . '.env');
}
if (!$this->env = parse_ini_file($envPath . '.env', true)) {
ProcessException::error([
'msg' => [
'msg' => 'Parse ini file fail',
]
]);
}
}

/**
Expand Down

0 comments on commit 83f7069

Please sign in to comment.