Re: include() suggestion

From: Date: Sun, 18 Mar 2001 00:11:35 +0000
Subject: Re: include() suggestion
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-44415@lists.php.net to get a copy of this message
Say you have index.php and 20 lines into index.php you include file.inc and there's an error on line 30 of file.inc, but I'm pretty sure PHP would say there was an error on line 50 of index.php and not like 30 of file.inc. It doesn't keep track of included files as separate files that are called but rather sort of merges it in memory into one file to run it seems. Steve "Don Read" <dread@texas.net> wrote in message news:XFMail.010317173312.dread@texas.net... > > 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. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#44415) next »