From 5d146c1dfd199a3c6cb5533c5ea016d10c854547 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Mon, 17 Oct 2016 12:07:54 +0900 Subject: [PATCH] toggle db debug flag after general setting --- www/libs/Class.DB.IO.inc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/www/libs/Class.DB.IO.inc b/www/libs/Class.DB.IO.inc index db08d7b7..b22be4e7 100644 --- a/www/libs/Class.DB.IO.inc +++ b/www/libs/Class.DB.IO.inc @@ -762,6 +762,26 @@ // PUBLIC METHODS // ************************************************************* + // METHOD db_set_debug + // PARAMS true/false or none + // RETURN new set debug flag + // DESC switches the debug flag on or off + // if none given, then the debug flag auto switches from + // the previous setting to either then on or off + // else override with boolean true/false + public function db_set_debug($debug = '') + { + if ($debug === true) + $this->db_debug = 1; + elseif ($debug === false) + $this->db_debug = 0; + elseif ($this->db_debug) + $this->db_debug = 0; + elseif (!$this->db_debug) + $this->db_debug = 1; + return $this->db_debug; + } + // METHOD db_reset_query_called // PARAMS query // RETURN none