Skip to content

Commit 8b82c3d

Browse files
authored
Merge pull request #3 from vojtasvoboda/fixes/use-env-variables
Read configuration properties directly from ENV variables
2 parents 922354e + 0da9258 commit 8b82c3d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/FlexiPeeHP/FlexiBeeRO.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,8 @@ public function setupProperty($options, $name, $constant = null) {
497497
$this->$name = $options[$name];
498498
} elseif (array_key_exists($constant, $options)) {
499499
$this->$name = $options[$constant];
500+
} elseif (property_exists($this, $name) && ($env = getenv($constant)) && !empty($env)) {
501+
$this->$name = getenv($constant);
500502
} else {
501503
if (property_exists($this, $name) && !empty($constant) && defined($constant)) {
502504
$this->$name = constant($constant);

0 commit comments

Comments
 (0)