| @@ 226-248 (lines=23) @@ | ||
| 223 | } |
|
| 224 | ||
| 225 | // Debugging. |
|
| 226 | if ($db_show_debug === true) |
|
| 227 | { |
|
| 228 | $debug = Debug::instance(); |
|
| 229 | ||
| 230 | // Get the file and line number this function was called. |
|
| 231 | list ($file, $line) = $this->error_backtrace('', '', 'return', __FILE__, __LINE__); |
|
| 232 | ||
| 233 | if (!empty($_SESSION['debug_redirect'])) |
|
| 234 | { |
|
| 235 | $debug->merge_db($_SESSION['debug_redirect']); |
|
| 236 | // @todo this may be off by 1 |
|
| 237 | $this->_query_count += count($_SESSION['debug_redirect']); |
|
| 238 | $_SESSION['debug_redirect'] = array(); |
|
| 239 | } |
|
| 240 | ||
| 241 | // Don't overload it. |
|
| 242 | $st = microtime(true); |
|
| 243 | $db_cache = array(); |
|
| 244 | $db_cache['q'] = $this->_query_count < 50 ? $db_string : '...'; |
|
| 245 | $db_cache['f'] = $file; |
|
| 246 | $db_cache['l'] = $line; |
|
| 247 | $db_cache['s'] = $st - $time_start; |
|
| 248 | } |
|
| 249 | ||
| 250 | // First, we clean strings out of the query, reduce whitespace, lowercase, and trim - so we can check it over. |
|
| 251 | if (empty($modSettings['disableQueryCheck'])) |
|
| @@ 176-198 (lines=23) @@ | ||
| 173 | } |
|
| 174 | ||
| 175 | // Debugging. |
|
| 176 | if ($db_show_debug === true) |
|
| 177 | { |
|
| 178 | $debug = Debug::instance(); |
|
| 179 | ||
| 180 | // Get the file and line number this function was called. |
|
| 181 | list ($file, $line) = $this->error_backtrace('', '', 'return', __FILE__, __LINE__); |
|
| 182 | ||
| 183 | if (!empty($_SESSION['debug_redirect'])) |
|
| 184 | { |
|
| 185 | $debug->merge_db($_SESSION['debug_redirect']); |
|
| 186 | // @todo this may be off by 1 |
|
| 187 | $this->_query_count += count($_SESSION['debug_redirect']); |
|
| 188 | $_SESSION['debug_redirect'] = array(); |
|
| 189 | } |
|
| 190 | ||
| 191 | // Don't overload it. |
|
| 192 | $st = microtime(true); |
|
| 193 | $db_cache = array(); |
|
| 194 | $db_cache['q'] = $this->_query_count < 50 ? $db_string : '...'; |
|
| 195 | $db_cache['f'] = $file; |
|
| 196 | $db_cache['l'] = $line; |
|
| 197 | $db_cache['s'] = $st - $time_start; |
|
| 198 | } |
|
| 199 | ||
| 200 | // First, we clean strings out of the query, reduce whitespace, lowercase, and trim - so we can check it over. |
|
| 201 | if (empty($modSettings['disableQueryCheck'])) |
|