Code Duplication    Length = 23-23 lines in 2 locations

Sources/Subs-Db-mysql.php 1 location

@@ 429-451 (lines=23) @@
426
	}
427
428
	// Debugging.
429
	if (isset($db_show_debug) && $db_show_debug === true)
430
	{
431
		// Get the file and line number this function was called.
432
		list ($file, $line) = smf_db_error_backtrace('', '', 'return', __FILE__, __LINE__);
433
434
		// Initialize $db_cache if not already initialized.
435
		if (!isset($db_cache))
436
			$db_cache = array();
437
438
		if (!empty($_SESSION['debug_redirect']))
439
		{
440
			$db_cache = array_merge($_SESSION['debug_redirect'], $db_cache);
441
			$db_count = count($db_cache) + 1;
442
			$_SESSION['debug_redirect'] = array();
443
		}
444
445
		// Don't overload it.
446
		$st = microtime();
447
		$db_cache[$db_count]['q'] = $db_count < 50 ? $db_string : '...';
448
		$db_cache[$db_count]['f'] = $file;
449
		$db_cache[$db_count]['l'] = $line;
450
		$db_cache[$db_count]['s'] = array_sum(explode(' ', $st)) - array_sum(explode(' ', $time_start));
451
	}
452
453
	// First, we clean strings out of the query, reduce whitespace, lowercase, and trim - so we can check it over.
454
	if (empty($modSettings['disableQueryCheck']))

Sources/Subs-Db-postgresql.php 1 location

@@ 396-418 (lines=23) @@
393
	}
394
395
	// Debugging.
396
	if (isset($db_show_debug) && $db_show_debug === true)
397
	{
398
		// Get the file and line number this function was called.
399
		list ($file, $line) = smf_db_error_backtrace('', '', 'return', __FILE__, __LINE__);
400
401
		// Initialize $db_cache if not already initialized.
402
		if (!isset($db_cache))
403
			$db_cache = array();
404
405
		if (!empty($_SESSION['debug_redirect']))
406
		{
407
			$db_cache = array_merge($_SESSION['debug_redirect'], $db_cache);
408
			$db_count = count($db_cache) + 1;
409
			$_SESSION['debug_redirect'] = array();
410
		}
411
412
		$st = microtime();
413
		// Don't overload it.
414
		$db_cache[$db_count]['q'] = $db_count < 50 ? $db_string : '...';
415
		$db_cache[$db_count]['f'] = $file;
416
		$db_cache[$db_count]['l'] = $line;
417
		$db_cache[$db_count]['s'] = array_sum(explode(' ', $st)) - array_sum(explode(' ', $time_start));
418
	}
419
420
	// First, we clean strings out of the query, reduce whitespace, lowercase, and trim - so we can check it over.
421
	if (empty($modSettings['disableQueryCheck']))