diff options
| author | Christian Fowler <spider@viovio.com> | 2006-03-20 19:35:18 +0000 |
|---|---|---|
| committer | Christian Fowler <spider@viovio.com> | 2006-03-20 19:35:18 +0000 |
| commit | 9b9c2b1f170c2cf22b2a01e32d1e8dda71cf3635 (patch) | |
| tree | 6dbee0733a988a3f5613736e8ff7276d7da94da2 /BitDbPear.php | |
| parent | 0e37c455797ce33d8c1a811166af514cd7201811 (diff) | |
| download | kernel-9b9c2b1f170c2cf22b2a01e32d1e8dda71cf3635.tar.gz kernel-9b9c2b1f170c2cf22b2a01e32d1e8dda71cf3635.tar.bz2 kernel-9b9c2b1f170c2cf22b2a01e32d1e8dda71cf3635.zip | |
add ADODB like debug output to PEAR::Db
Diffstat (limited to 'BitDbPear.php')
| -rwxr-xr-x | BitDbPear.php | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/BitDbPear.php b/BitDbPear.php index bbdde51..623b319 100755 --- a/BitDbPear.php +++ b/BitDbPear.php @@ -3,7 +3,7 @@ * ADOdb Library interface Class * * @package kernel - * @version $Header: /cvsroot/bitweaver/_bit_kernel/BitDbPear.php,v 1.14 2006/03/14 14:57:44 wakeworks Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_kernel/BitDbPear.php,v 1.15 2006/03/20 19:35:18 spiderr Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -32,11 +32,15 @@ require_once( KERNEL_PKG_PATH.'BitDbBase.php' ); */ class BitDbPear extends BitDb { - + var $mDebug; + function BitDbPear( $pPearDsn=NULL, $pPearOptions = NULL ) { + global $gDebug; parent::BitDb(); + $this->mDebug = $gDebug; + if( empty( $pPearDsn ) ) { global $gBitDbType, $gBitDbUser, $gBitDbPassword, $gBitDbHost, $gBitDbName; @@ -151,6 +155,13 @@ class BitDbPear extends BitDb } $this->queryComplete(); + if( !empty( $this->mDebug ) ) { + print( "<tt>\n".vsprintf( str_replace( '?', "'%s'", $this->mDb->last_query ), $this->mDb->last_parameters )."\n</tt><br/>" ); + if( $this->mDebug == 99 ) { + bt(); + } + } + return $result; } @@ -407,6 +418,14 @@ class BitDbPear extends BitDb return( $ret ); } + /** will activate ADODB's native debugging output + * @param pLevel debugging level - FALSE is off, TRUE is on, 99 is verbose + **/ + function debug( $pLevel=99 ) { + $this->mDebug = $pLevel; + } + + /** * Create a list of tables available in the current database * |
