From e04e49bb32dc9a0bec60fee2cb86900ff61853e0 Mon Sep 17 00:00:00 2001 From: Steve Kamerman Date: Sun, 19 May 2013 16:54:35 -0400 Subject: [PATCH] Added support for standard YAML key/value pairs --- PHPCI/Plugin/Env.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/PHPCI/Plugin/Env.php b/PHPCI/Plugin/Env.php index 4984d100..1de016fb 100644 --- a/PHPCI/Plugin/Env.php +++ b/PHPCI/Plugin/Env.php @@ -32,9 +32,14 @@ class Env implements \PHPCI\Plugin public function execute() { $success = true; - foreach ($this->env_vars as $value) { - // This allows the developer to specify env vars like " - FOO=bar" or " - FOO: bar" - $env_var = is_array($value)? key($value).'='.current($value): $value; + foreach ($this->env_vars as $key => $value) { + if (is_numeric($key)) { + // This allows the developer to specify env vars like " - FOO=bar" or " - FOO: bar" + $env_var = is_array($value)? key($value).'='.current($value): $value; + } else { + // This allows the standard syntax: "FOO: bar" + $env_var = "$key=$value"; + } if (!putenv($env_var)) { $success = false;