Make the SAVEQUERIES define more flexible. Fixes #6764 props filosofo.

git-svn-id: https://develop.svn.wordpress.org/trunk@8134 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood 2008-06-20 15:17:09 +00:00
parent f69d72a502
commit 6869890baf
1 changed files with 2 additions and 5 deletions

View File

@ -11,9 +11,6 @@ define('OBJECT_K', 'OBJECT_K', false);
define('ARRAY_A', 'ARRAY_A', false); define('ARRAY_A', 'ARRAY_A', false);
define('ARRAY_N', 'ARRAY_N', false); define('ARRAY_N', 'ARRAY_N', false);
if (!defined('SAVEQUERIES'))
define('SAVEQUERIES', false);
class wpdb { class wpdb {
var $show_errors = false; var $show_errors = false;
@ -279,13 +276,13 @@ class wpdb {
$this->last_query = $query; $this->last_query = $query;
// Perform the query via std mysql_query function.. // Perform the query via std mysql_query function..
if (SAVEQUERIES) if ( defined('SAVEQUERIES') && SAVEQUERIES )
$this->timer_start(); $this->timer_start();
$this->result = @mysql_query($query, $this->dbh); $this->result = @mysql_query($query, $this->dbh);
++$this->num_queries; ++$this->num_queries;
if (SAVEQUERIES) if ( defined('SAVEQUERIES') && SAVEQUERIES )
$this->queries[] = array( $query, $this->timer_stop(), $this->get_caller() ); $this->queries[] = array( $query, $this->timer_stop(), $this->get_caller() );
// If there is an error then take note of it.. // If there is an error then take note of it..