Code Duplication    Length = 23-23 lines in 2 locations

sources/database/Db-postgresql.class.php 1 location

@@ 226-248 (lines=23) @@
223
		}
224
225
		// Debugging.
226
		if ($db_show_debug === true)
227
		{
228
			$debug = Debug::get();
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']))

sources/database/Db-mysql.class.php 1 location

@@ 183-205 (lines=23) @@
180
		}
181
182
		// Debugging.
183
		if ($db_show_debug === true)
184
		{
185
			$debug = Debug::get();
186
187
			// Get the file and line number this function was called.
188
			list ($file, $line) = $this->error_backtrace('', '', 'return', __FILE__, __LINE__);
189
190
			if (!empty($_SESSION['debug_redirect']))
191
			{
192
				$debug->merge_db($_SESSION['debug_redirect']);
193
				// @todo this may be off by 1
194
				$this->_query_count += count($_SESSION['debug_redirect']);
195
				$_SESSION['debug_redirect'] = array();
196
			}
197
198
			// Don't overload it.
199
			$st = microtime(true);
200
			$db_cache = array();
201
			$db_cache['q'] = $this->_query_count < 50 ? $db_string : '...';
202
			$db_cache['f'] = $file;
203
			$db_cache['l'] = $line;
204
			$db_cache['s'] = $st - $time_start;
205
		}
206
207
		// First, we clean strings out of the query, reduce whitespace, lowercase, and trim - so we can check it over.
208
		if (empty($modSettings['disableQueryCheck']))