RE: [PHP] include() suggestion

From: Date: Sat, 17 Mar 2001 23:33:12 +0000
Subject: RE: [PHP] include() suggestion
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-44414@lists.php.net to get a copy of this message
On 17-Mar-01 Steve Wardell wrote: > I didn't know where else to post feature requests so I'll post it here. > Could we get included files to not merely be sucked in to the file that is > including it but still think of it as a distinctive file in terms of getting > debug output for errors. The reasons for this are 2 fold: > > 1) You could see all the files run by a particular page and not have to > trace through files to see all the files which are called during a request > to the server. > 2) For error messages, it would give you the line number of the particular > file that has the error and not the line number of the merged single file. > Errm ... Not sure what you mean by 'the line number of the merged single file.' ? a syntax error will mention the correct file unless you don't close a block. For trace debuging i use (in common.php): function debug($fl, $ln, $msg='') { global $debug; if (! empty($debug)) printf("<DIV ALIGN=\"LEFT\"><FONT SIZE=\"-1\">%s %s:\n%s</FONT></DIV>", $fl , $ln ,$msg); } and used as : $qry="select id, name, contact, email, addr1, addr2, city, state, 1zip, country, left(datesigned,10) as ds from webmaster where id=$qwid"; debug(__FILE__,__LINE__, $qry); $res = mysql_query($qry); if ( $res) { ... just add &debug=1 to the url to trace out execution. Regards, -- Don Read dread@texas.net -- If you are going to sin, sin against God, not the bureaucracy. God will forgive you but the bureaucrats won't.

« previous php.general (#44414) next »