Commit 897aae3e authored by Steven Wittens's avatar Steven Wittens
Browse files

- #27846: Clean up dev_query code in db_query()

parent 017e3d14
......@@ -72,22 +72,16 @@ function db_connect($url) {
* Helper function for db_query().
*/
function _db_query($query, $debug = 0) {
global $active_db;
global $queries;
static $dev_query;
global $active_db, $queries;
if (!isset($dev_query)) {
$dev_query = function_exists('dev_query') ? variable_get('dev_query', 0) : $GLOBALS['conf']['dev_query'];
}
if ($dev_query) {
if (variable_get('dev_query', 0)) {
list($usec, $sec) = explode(' ', microtime());
$timer = (float)$usec + (float)$sec;
}
$result = mysql_query($query, $active_db);
if ($dev_query) {
if (variable_get('dev_query', 0)) {
list($usec, $sec) = explode(' ', microtime());
$stop = (float)$usec + (float)$sec;
$diff = $stop - $timer;
......
......@@ -59,22 +59,16 @@ function db_connect($url) {
* Helper function for db_query().
*/
function _db_query($query, $debug = 0) {
global $active_db, $last_result;
global $queries;
static $dev_query;
global $active_db, $last_result, $queries;
if (!isset($dev_query)) {
$dev_query = function_exists('dev_query') ? variable_get('dev_query', 0) : $GLOBALS['conf']['dev_query'];
}
if ($dev_query) {
if (variable_get('dev_query', 0)) {
list($usec, $sec) = explode(' ', microtime());
$timer = (float)$usec + (float)$sec;
}
$last_result = pg_query($active_db, $query);
if ($dev_query) {
if (variable_get('dev_query', 0)) {
list($usec, $sec) = explode(' ', microtime());
$stop = (float)$usec + (float)$sec;
$diff = $stop - $timer;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment