Re: included_by() possible?
| From: | Flavien Lebarbé | Date: | Fri, 25 Aug 2000 14:34:04 +0000 |
| Subject: | Re: included_by() possible? | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-30649@lists.php.net to get a copy of this message | ||
Hello,
As we're about __FILE__ and friends... And talking about
feature requests :
Wouldn't it be nice to have a more general api than the
proposed included_by() that would return which file included
the current one ? Why not a get_include_history() ?
Example :
---a.php
<?php
include('b');
?>
---b.inc
<?php
include('c.inc');
?>
---c.inc
<?php
$files=get_include_history();
?>
---
So that in $files we'd have :
$files[0]='a.php'
$files[1]='b.inc'
$files[2]='c.inc'
I did not have a look at the implementation of the include
functions, but this feature would make sense to me.
More than that, we could also use the history for error
messages (quite useful!) as well as detecting infinite loops
('a.php' includes 'b.php' which includes 'a.php'...) that cause
crashes at the moment...
What do you guys think about this ?
Just an idea,
I would be interested on working on this if you think this is
desirable.
Flavien.