The parameters need to be set up as environment variables so that
getenv() can retrieve them too
diff --git a/core/php7.1Action/router.php b/core/php7.1Action/router.php
index 1ec8ecb..eadc153 100644
--- a/core/php7.1Action/router.php
+++ b/core/php7.1Action/router.php
@@ -208,7 +208,6 @@
if (array_key_exists('value', $post) && is_array($post['value'])) {
$args = json_encode($post['value']);
}
- $env['WHISK_INPUT'] = $args;
// run the action
list($returnCode, $stdout, $stderr) = runPHP(
diff --git a/core/php7.2Action/router.php b/core/php7.2Action/router.php
index c3ada90..3bf01a1 100644
--- a/core/php7.2Action/router.php
+++ b/core/php7.2Action/router.php
@@ -229,7 +229,6 @@
if (array_key_exists('value', $post) && is_array($post['value'])) {
$args = $post['value'];
}
- $_ENV['WHISK_INPUT'] = json_encode($args);
// run the action
require __DIR__ . '/src/vendor/autoload.php';
diff --git a/core/php7.3Action/runner.php b/core/php7.3Action/runner.php
index 6941986..5923818 100755
--- a/core/php7.3Action/runner.php
+++ b/core/php7.3Action/runner.php
@@ -49,10 +49,10 @@
// convert all parameters other than value to environment variables
foreach ($data as $key => $value) {
- if ($key == 'value') {
- $_ENV['WHISK_INPUT'] = $data['value'] ?? [];
- } else {
- $_ENV['__OW_' . strtoupper($key)] = $value;
+ if ($key !== 'value') {
+ $envKeyName = '__OW_' . strtoupper($key);
+ $_ENV[$envKeyName] = $value;
+ putenv($envKeyName . '=' . $value);
}
}