Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Commit

Permalink
Using foreach for env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
pietrinoatzenimfm committed Mar 5, 2019
1 parent c02a209 commit 4f8fe1e
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/NodeJS/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -375,15 +375,9 @@ public function start(Process $process = null)
$this->nodeBin,
$this->serverPath,
));
$processBuilder->setEnv('HOST', $this->host)
->setEnv('PORT', $this->port);

if (!empty($this->nodeModulesPath)) {
$processBuilder->setEnv('NODE_PATH', $this->nodeModulesPath);
}

if (!empty($this->options)) {
$processBuilder->setEnv('OPTIONS', json_encode($this->options));
foreach ($env as $key => $val) {
$processBuilder->setEnv($key, $val);
}

$process = $processBuilder->getProcess();
Expand Down

0 comments on commit 4f8fe1e

Please sign in to comment.