aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-04-22 21:14:11 -0700
committerfriendica <info@friendica.com>2013-04-22 21:14:11 -0700
commit150b18005ac69896894d2c7e2b3fccc3c23eefec (patch)
treeafa33ebfccfcc15a63126ca03a3669c6de867bef
parent552f03122c9ec066f5728fc4629d155937fd3620 (diff)
downloadvolse-hubzilla-150b18005ac69896894d2c7e2b3fccc3c23eefec.tar.gz
volse-hubzilla-150b18005ac69896894d2c7e2b3fccc3c23eefec.tar.bz2
volse-hubzilla-150b18005ac69896894d2c7e2b3fccc3c23eefec.zip
cleanup debugging code in abstracted db driver
-rw-r--r--include/dba/dba_mysqli.php21
1 files changed, 15 insertions, 6 deletions
diff --git a/include/dba/dba_mysqli.php b/include/dba/dba_mysqli.php
index 10a0a05c2..af9a2434e 100644
--- a/include/dba/dba_mysqli.php
+++ b/include/dba/dba_mysqli.php
@@ -25,14 +25,24 @@ class dba_mysqli extends dba_driver {
if($this->db->errno)
$this->error = $this->db->error;
- if($result === false || $this->error) {
- logger('dba_mysqli: ' . printable($sql) . ' returned false.' . "\n" . $this->error);
- if(file_exists('dbfail.out'))
- file_put_contents('dbfail.out', datetime_convert() . "\n" . printable($sql) . ' returned false' . "\n" . $this->error . "\n", FILE_APPEND);
+
+ if($this->error) {
+ logger('dba_mysqli: ERROR: ' . printable($sql) . "\n" . $this->error);
+ if(file_exists('dbfail.out')) {
+ file_put_contents('dbfail.out', datetime_convert() . "\n" . printable($sql) . "\n" . $this->error . "\n", FILE_APPEND);
+ }
}
- if(($result === true) || ($result === false))
+ if(($result === true) || ($result === false)) {
+ if($this->debug) {
+ logger('dba_mysqli: DEBUG: returns ' . (($result) ? 'true' : 'false'));
+ }
return $result;
+ }
+
+ if($this->debug) {
+ logger('dba_mysqli: DEBUG: ' . printable($sql) . ' returned ' . $result->num_rows . ' results.');
+ }
$r = array();
if($result->num_rows) {
@@ -40,7 +50,6 @@ class dba_mysqli extends dba_driver {
$r[] = $x;
$result->free_result();
if($this->debug) {
- logger('dba_mysqli: query: ' . printable($sql) . ' returned ' . $result->num_rows . ' results.');
logger('dba_mysqli: ' . printable(print_r($r,true)));
}
}