From 31d2446b03ddaaa81063870149e16f2938148efc Mon Sep 17 00:00:00 2001 From: Sieciech Date: Sat, 7 Aug 2021 11:17:47 +0200 Subject: [PATCH] fix --- tools/putenv/putenv.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/putenv/putenv.php b/tools/putenv/putenv.php index 029a4cd..ce49e58 100644 --- a/tools/putenv/putenv.php +++ b/tools/putenv/putenv.php @@ -10,6 +10,7 @@ class PutEnv { public function __construct() { $argv = $_SERVER['argv']; $argc = sizeof($argv); + print_r([$argc, $argv]); switch($argc) { case 3: $this->file = $argv[1]; @@ -22,6 +23,12 @@ class PutEnv { $this->key = $argv[2]; $this->value = fgets(STDIN); break; + + default: + echo "usage: + php8.0 putenv.php filename key value + echo value | php8.0 putenv filename key"; + throw new Exception("invalid params"); } if (!file_exists($this->file)) { throw new Exception('File not found');