function _log($s) { if (!fbDebug::debugging()) { return ''; } if (fbDebug::_level() & FB_DEBUG_JAVASCRIPT) { fbDebug::_javascript($s); } if (fbDebug::_level() & (FB_DEBUG_HTML | FB_DEBUG_TEXT)) { print $s; print "\n"; } if (fbDebug::_level() & FB_DEBUG_LOG) { fbDebug::_error_log($s); } return $s; }
function rsdumpNoSql(&$rs) { if (!fbDebug::debugging()) { return ''; } $s = ''; if ((fbDebug::_level() & FB_DEBUG_SELECT) == FB_DEBUG_SELECT) { if (fbDebug::_level() & (FB_DEBUG_HTML | FB_DEBUG_JAVASCRIPT)) { ADODB_debug::rs2html($rs); } elseif (fbDebug::_level() & FB_DEBUG_TEXT) { ADODB_debug::rs2text($rs); } elseif (fbDebug::_level() & FB_DEBUG_LOG) { fbDebug::_error_log(ADODB_debug::_rs2text($rs)); } } return $s; }
function &Execute($sql, $inputarr = false, $arg3 = false) { $this->_start(); $rs =& parent::Execute($sql, $inputarr, $arg3); if (!$rs) { // \todo use adodb-error.inc.php values instead // key violations should not be fatal errors if ($this->ErrorNo() == 1062) { return $rs; } $this->_error("Execute", $sql, $inputarr); } $affected_rows = $this->Affected_Rows(); $this->_end(); $this->_dumpSql("Execute", $sql, $inputarr); $this->_explain($sql, $inputarr, $arg3); $this->_elapsed(); ADODB_debug::rsdumpNoSql($rs); if ($rs && fbDebug::_level() & FB_DEBUG_SQL) { if (preg_match('/^\\s*insert\\s+|^\\s*delete\\s+|^\\s*update\\s+/i', $sql)) { fbDebug::dump($affected_rows, 'Affected_Rows'); } } // fbDebug::log(fbDebug::hr()); return $rs; }