From 2655d679bf96304bb71d1980dce8746a2da20e02 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Fri, 30 Aug 2024 22:33:16 +0200 Subject: [PATCH] bin/dbq.php --- bin/dbq.php | 17 +++++++++++++++++ www/dbq/dbq.php | 4 +++- 2 files changed, 20 insertions(+), 1 deletion(-) 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; -- 2.47.3