Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
WyattCast44 committed Jul 17, 2022
1 parent c126f00 commit 9a521b7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

### 0.2.1

- Fix array_filter filtering out all env variables
- Change method name from `addEnvVars()` to `withEnvVars()` to match configuration.

### 0.2.0

- Add method and configuration to allow the ability to add env variables to the array of env vars that will be passed to the process
Expand Down
3 changes: 3 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

var_dump($_ENV, getenv());
4 changes: 2 additions & 2 deletions src/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function useRouter(string $path): self
return $this;
}

public function addEnvVars(array $vars): self
public function withEnvVars(array $vars): self
{
$this->envVarsToPass = array_merge(
$this->envVarsToPass,
Expand Down Expand Up @@ -164,7 +164,7 @@ private function buildServeCommand(): array
private function buildPassingEnvVarArray(): array
{
return array_merge(array_filter($this->envVarsToPass, function ($key) {
return in_array($key, $this->configuration['withoutEnvVars']);
return !in_array($key, $this->configuration['withoutEnvVars']);
}, ARRAY_FILTER_USE_KEY), $this->configuration['withEnvVars']);
}

Expand Down

0 comments on commit 9a521b7

Please sign in to comment.