Changeset 1194 in subversion
- Timestamp:
- Mar 19, 2008 10:36:47 AM (5 years ago)
- Location:
- trunk/roundcubemail/program/include
- Files:
-
- 3 edited
-
main.inc (modified) (1 diff)
-
rcube_db.inc (modified) (1 diff)
-
rcube_mdb2.inc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/main.inc
r1145 r1194 75 75 $DB = new $dbclass($CONFIG['db_dsnw'], $CONFIG['db_dsnr'], $CONFIG['db_persistent']); 76 76 $DB->sqlite_initials = $INSTALL_PATH.'SQL/sqlite.initial.sql'; 77 $DB->set_debug((bool)$CONFIG['sql_debug']); 77 78 $DB->db_connect('w'); 78 79 -
trunk/roundcubemail/program/include/rcube_db.inc
r1089 r1194 154 154 $this->db_connected = $this->db_handle ? TRUE : FALSE; 155 155 } 156 157 158 /** 159 * Activate/deactivate debug mode 160 * (not implemented) 161 */ 162 function set_debug($dbg = true) 163 { 156 164 157 165 } 166 167 158 168 /** 159 169 * Getter for error state -
trunk/roundcubemail/program/include/rcube_mdb2.inc
r1084 r1194 49 49 var $db_error = false; 50 50 var $db_error_msg = ''; 51 var $debug_mode = false; 51 52 52 53 var $a_query_results = array('dummy'); … … 95 96 { 96 97 // Use persistent connections if available 97 $dbh = MDB2::connect($dsn, 98 array('persistent' => $this->db_pconn, 98 $dbh = MDB2::connect($dsn, array( 99 'emulate_prepared' => true, 100 'persistent' => $this->db_pconn, 101 'debug' => $this->debug_mode, 102 'debug_handler' => 'mdb2_debug_handler', 99 103 'portability' => MDB2_PORTABILITY_ALL ^ MDB2_PORTABILITY_EMPTY_TO_NULL)); 100 104 … … 156 160 } 157 161 162 163 /** 164 * Activate/deactivate debug mode 165 * 166 * @param boolean True if SQL queries should be logged 167 */ 168 function set_debug($dbg = true) 169 { 170 $this->debug_mode = $dbg; 171 if ($this->db_connected) 172 $this->db_handle->setOption('debug', $dbg); 173 } 158 174 159 175 … … 570 586 } // end class rcube_db 571 587 588 589 /* this is our own debug handler for the MDB2 connection */ 590 function mdb2_debug_handler(&$db, $scope, $message, $context = array()) 591 { 592 if ($scope != 'prepare') 593 { 594 $debug_output = $scope . '('.$db->db_index.'): '; 595 $debug_output .= $message . $db->getOption('log_line_break'); 596 write_log('sqllog', $debug_output); 597 } 598 } 599 600 572 601 ?>
Note: See TracChangeset
for help on using the changeset viewer.
