FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Plugins and Code Hacks » fudforum debugging output >>File (re-routing the debug infos to file(s))
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
fudforum debugging output >>File [message #168746] Fri, 12 July 2013 11:28
captain picard is currently offline  captain picard   Austria
Messages: 15
Registered: March 2013
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
hi there,

in case of debugging an ldap-plugin-tweak (for generating an alias like "username (Surename Gname)" (thanks btw to multitool) i tried to use the fud-forums debugging function wich resulted in headers-allredy-sent errors.

a solution could be a general switch in the general options of FUD-forum to reroute the debugging output to file(s), so the auth-headers created by the ldap plugin can get throu.

i used this to reroute the debugging information... to get logged in again :-S

inserted in forum\index.php

function dbg($dbgstr){
	$fh = fopen($GLOBALS['WWW_ROOT_DISK'] .'DEBUGGING/'.str_replace('/','_',$_SERVER['PHP_SELF']), 'a');
	@fwrite($fh, "\r\n\r\nldap:dbg ".date("H:i:s").":");
	fwrite($fh, $dbgstr);
	fclose($fh);
}


and edited the q()-function that prints out the debugging info...

deleting the following...
		echo '<hr><b>Query #'. $GLOBALS['__DB_INC_INTERNALS__']['query_count'] .'</b><small>';
		echo ': time taken:     <i>'. number_format($GLOBALS['__DB_INC_INTERNALS__']['last_time'], 4) .'</i>';
		echo ', affected rows:  <i>'. db_affected() .'</i>';
		echo ', total sql time: <i>'.  number_format($GLOBALS['__DB_INC_INTERNALS__']['total_sql_time'], 4) .'</i>';
		echo '<pre>'. preg_replace('!\s+!', ' ', htmlspecialchars($query)) .'</pre></small>';
		


inserting the folling instead:
		dbg('<hr><b>Query #'. $GLOBALS['__DB_INC_INTERNALS__']['query_count'] .'</b><small>');
		dbg(': time taken:     <i>'. number_format($GLOBALS['__DB_INC_INTERNALS__']['last_time'], 4) .'</i>');
		dbg(', affected rows:  <i>'. db_affected() .'</i>');
		dbg(', total sql time: <i>'.  number_format($GLOBALS['__DB_INC_INTERNALS__']['total_sql_time'], 4) .'</i>');
		dbg('<pre>'. preg_replace('!\s+!', ' ', htmlspecialchars($query)) .'</pre></small>');


i'll post the tweak for the ldap-plugins ALIAS-enhancement in it's origin thread next time.

can you guide me a little bit
.where to set up the function correctly (as i had to modify the q()-function it in several cached files) and
.how to add a checkbox-field in the general setting for this?

thank you

david
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: LDAP with SSL support (LDAPS)
Next Topic: LDAP Plugin Enhancements (Updated!)
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Oct 23 11:08:13 EDT 2017

Total time taken to generate the page: 0.00529 seconds