예제 #1
0
 function _sqldump($sql, $fields = false)
 {
     //		global $conn;
     /// \todo fixme
     //		$conn = $dbTiki;
     #require_once MERCURY_LIB . '/common/fbDb.php';
     #$conn				= fbDb::conn();
     if (!fbDebug::debugging()) {
         return '';
     }
     $s = '';
     $rs = $conn->execute($sql, $fields);
     if (!$rs) {
         $s .= fbDebug::pre('ErrorMsg="' . $conn->errormsg() . '"');
         $s .= fbDebug::_dump($sql, 'sql');
         if ($fields) {
             $s .= fbDebug::_dump($fields, 'fields');
         }
         return $s;
     }
     $s .= ADODB_debug::_rsdump($rs);
     return $s;
 }
예제 #2
0
파일: Debug.php 프로젝트: Artea/freebeer
 function _dump_globals($ignore_vars = '', $no_uc_vars = false)
 {
     if (!fbDebug::debugging()) {
         return '';
     }
     $g = $GLOBALS;
     static $skip_vars = '^argc$|^argv$|^ADODB_Database$|^ADODB_vers$|^conf$|^conn$|^sectioninfo$|^sessname$';
     //		if ($ignore_vars) {
     //			$match = '/' . $ignore_vars . '|' . $skip_vars . '/';
     //		} else {
     $match = '/' . $skip_vars . '/';
     //		}
     $rv = fbDebug::hr();
     $rv .= fbDebug::pre(sprintf("\n%d GLOBALS (less {$match}): \n", count($g)));
     ksort($g);
     reset($g);
     while (list($key, $val) = each($g)) {
         if (preg_match($match, $key)) {
             continue;
         }
         if ($no_uc_vars) {
             if (strtoupper($key) == $key) {
                 continue;
             }
         }
         $rv .= fbDebug::_dump($val, $key);
     }
     $rv .= "\n";
     $rv .= fbDebug::hr();
     return $rv;
 }