← Back to team overview

anewt-developers team mailing list archive

[Branch ~sander-sinaasappel/anewt/anewt.new.cxs] Rev 1487: [database] Fix debugging for delayed connections

 

------------------------------------------------------------
revno: 1487
committer: Sander van Schouwenburg <sander@xxxxxxxxxxxxx>
branch nick: anewt.new.cxs
timestamp: Mon 2010-01-04 14:02:23 +0100
message:
  [database] Fix debugging for delayed connections
  
  PreparedQuery takes over debug settings from Database, but with a delayed
  connection the debug settings weren't initialized before the first execute.
  Therefore the first query isn't logged.
  
  
  (from anewt.new.svn:96)
modified:
  database/database.lib.php


--
lp:~sander-sinaasappel/anewt/anewt.new.cxs
https://code.launchpad.net/~sander-sinaasappel/anewt/anewt.new.cxs

Your team Anewt developers is subscribed to branch lp:~sander-sinaasappel/anewt/anewt.new.cxs.
To unsubscribe from this branch go to https://code.launchpad.net/~sander-sinaasappel/anewt/anewt.new.cxs/+edit-subscription.
=== modified file 'database/database.lib.php'
--- database/database.lib.php	2009-04-07 08:05:57 +0000
+++ database/database.lib.php	2010-01-04 13:02:23 +0000
@@ -69,8 +69,11 @@
 
 			$db = new DB($type);
 
-			if (!is_null($settings))
+			if (!is_null($settings)) {
 				$db->settings = $settings;
+				$db->debug = array_get_default($settings, 'debug', false);
+				$db->debug_print = array_get_default($settings, 'debug_print', false);
+			}
 		}
 
 		return $db;