diff options
author | Christian Helbling | 2018-10-08 09:15:19 +0200 |
---|---|---|
committer | Christian Helbling | 2018-10-08 09:15:19 +0200 |
commit | 51ed968a13e1664bd256e2adafcb1d5e3c4f4095 (patch) | |
tree | 976e16740ebaf651390435f80a1253252aa57e3a /it_debug.class | |
parent | adadae917b981ec4cccc29951a0bf22edb8fe380 (diff) | |
download | itools-51ed968a13e1664bd256e2adafcb1d5e3c4f4095.tar.gz itools-51ed968a13e1664bd256e2adafcb1d5e3c4f4095.tar.bz2 itools-51ed968a13e1664bd256e2adafcb1d5e3c4f4095.zip |
put behaviour of --debug in it::getopt into it_debug::set so we can use that in other places as well - for example in runtests
Diffstat (limited to 'it_debug.class')
-rw-r--r-- | it_debug.class | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/it_debug.class b/it_debug.class index d2aeb04..c508b5e 100644 --- a/it_debug.class +++ b/it_debug.class @@ -191,5 +191,17 @@ static function backtrace($p = array()) return join(" ", (array)$result); } +static function set($debug_string) +{ + foreach (preg_split('/[.,]/', $debug_string) as $ultrad) + { + $ultravar = preg_split('/[-=:]/', $ultrad, 2); + $GLOBALS["debug_$ultravar[0]"] = isset($ultravar[1]) ? $ultravar[1] : 1; + } + + # keep debug parameters in subrequests + $_SERVER['ULTRAHOSTNAME'] = it::replace(['^\.+' => '', '([^.])\.*$' => '\1.'], $debug_string) . $_SERVER['ULTRAHOSTNAME']; +} + } ?> |