feature : get_include_history () (was : Re: [PHP-DEV] included_by() possible?)
| From: | Flavien Lebarbé | Date: | Sat, 26 Aug 2000 01:06:34 +0000 |
| Subject: | feature : get_include_history () (was : Re: [PHP-DEV] included_by() possible?) | ||
| References: | 1 2 3 4 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-30702@lists.php.net to get a copy of this message | ||
Hello,
André, you do not need to convince me how such a future would be
useful... Having error messages saying :
"Error in blah.inc, line 13
included from foo.inc line 15
included from bar.inc line 623"
as well as beeing able to "get_include_history()" which returns
the status of this stack would help php developpers _a lot_ I
think. :)
As for implementation of this feature, I just had a look at it :
zend_execute, line 1957 is the place to go I think.
pseudo-code :
[line 2028] push ( &include_history_stack ,
inc_filename->value.str.val ,
CG(zend_lineno) );
[line 2029] zend_execute(...);
[line 2030] pop ( &include_history_stack );
Add a new function to ZEND :
get_include_history ()
{
/* dump include_history_stack into a php array and return it */
}
Modify zend_error to display this too.
What do Zend-gurus think about this ? Is it something that can
be done this way, would it be better to do it differently ?
Am I missing something ? Ideas ? Comments anyone ?
Flavien.