From: Nicolas Boisselier Date: Fri, 30 Aug 2024 20:33:16 +0000 (+0200) Subject: bin/dbq.php X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=2655d679bf96304bb71d1980dce8746a2da20e02;p=nb.git bin/dbq.php --- diff --git a/bin/dbq.php b/bin/dbq.php index 353bbf09..12d91a09 100755 --- a/bin/dbq.php +++ b/bin/dbq.php @@ -8,5 +8,22 @@ * Fix confusion between nb_api and bin/dbq * use instead directly what is used by nginx and do the query localy, otherwise just use curl */ +$_SERVER['REQUEST_URI'] = '/'; +$_SERVER['QUERY_STRING'] = ''; + +# NB 30.08.24: argv 2 query +if (isset($GLOBALS['argv']) and count($GLOBALS['argv'])>1) { + + $_SERVER['REQUEST_URI'] = $GLOBALS['argv'][1]; + + for($i=2;$i diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index 934d5be5..41ab6e69 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -785,7 +785,9 @@ class DbQ extends nb { $path = ''; $args = ''; - if (empty($_SERVER['REQUEST_URI'])) $_SERVER['REQUEST_URI'] = join('/',( count($GLOBALS['argv'])>0 ) ? array_slice($GLOBALS['argv'],1) : []); + #bye($GLOBALS['argv']); + # NB 30.08.24: Done in bin/dbq.php + //if (empty($_SERVER['REQUEST_URI'])) $_SERVER['REQUEST_URI'] = join('/',( count($GLOBALS['argv'])>0 ) ? array_slice($GLOBALS['argv'],1) : []); list ($path,$args) = strpos($_SERVER['REQUEST_URI'],'?') ? explode('?',$_SERVER['REQUEST_URI']) : [$_SERVER['REQUEST_URI'],'']; $this->uri = $path;