]> git.nbdom.net Git - nb.git/commitdiff
bin/dbq.php
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 5 Sep 2024 21:59:14 +0000 (23:59 +0200)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 5 Sep 2024 21:59:14 +0000 (23:59 +0200)
bin/dbq.php

index 81ee0efc38cf4f67c39824215b5d88fa23f885d0..2c1ff7f6f2626dab24d0bde0be6aa03240bdd54f 100755 (executable)
@@ -22,10 +22,12 @@ if (isset($GLOBALS['argv']) and count($GLOBALS['argv'])>1) {
                list($k,$v) = explode('=',trim($GLOBALS['argv'][$i]));  
 
                if ($k == '__YAML__') {
-                       #$str = file_get_contents($GLOBALS['argv'][$i+1]);
                        $str = file_get_contents($v);
-                       #bye($str);
-                       $_GET = nb::yaml_decode($str)[0];
+                       $_GET = Nb::yaml_decode($str)[0];
+
+               } elseif ($k == '__JSON__') {
+                       $str = file_get_contents($v);
+                       $_GET = Nb::json_decode($str)[0];
 
                } else {
                        $_GET[$k]= $v;