RE: [PHP] backtracing of includes

2001-12-28 Thread Jerry Verhoef (UGBI)

Don't think that a option like this exists.

But maybe you should consider using 

include_once or 
require_once

Also before you define the function use the function_exist() and if the
function already exists don't redecleare it.

Jerry Verhoef

-Original Message-
From: Henning Sprang [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 28, 2001 2:24 PM
To: [EMAIL PROTECTED]
Subject: [PHP] backtracing of includes


Hy,
I would like to know if there is a way to get information on the include
hierarchy of files in php, especially to find out where which file is
included and trace back the line from some file until the first called
php file.

My special case here and now is that I get an error that some function
is already declared and cannot be declared again because of this.
I know i must have included the file with that function somewhere
already, but as i have lots of nested includes I have trouble right now
to find the place where ist already happens.
I know I can prevent those things in future by using things as
require_once and so on, and i can search through all the code, making
yself a map on paper to see which file includes what, but what i really
want to know is, if i can ask some function to tell me where the
function which makes the error stated above and from where the file is
included, and from where this file again is include, going as far back
until i have my first-called php file.



I hope you can understand what i mean,

henning



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


The information contained in this email is confidential and
may be legally privileged. It is intended solely for the 
addressee. Access to this email by anyone else is 
unauthorized. If you are not the intended recipient, any 
form of disclosure, production, distribution or any action 
taken or refrained from in reliance on it, is prohibited and 
may be unlawful. Please notify the sender immediately.

The content of the email is not legally binding unless 
confirmed by letter bearing two authorized signatures.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] backtracing of includes

2001-12-28 Thread Henning Sprang

Hy,

Am 28 Dec 2001 14:27:50 +0100 schrieb Jerry Verhoef (UGBI):
 Don't think that a option like this exists.
 
 But maybe you should consider using 
 
 include_once or 
 require_once
 
 Also before you define the function use the function_exist() and if the
 function already exists don't redecleare it.

That's what I wrote - I know I can use things like that, but I am
curious if there are other ways to find out which file is included by
what and which function is defined in which file - i didn't find answers
about that in the manual.

Meanwhile I found out what the real problem was, namely that a function
was declared inside a function, and the parent function was called
twice, resulting in an error. I think it's generally not recommended to
declare functions inside functions as I see no obvious reason now when
this should be useful, only that it can make things complicated as i saw
right now.(btw: this code does not come from myself, i am just making
additions to it)

So, I am still curious if and how one can trace function definitions and
includes in a convenient way.

henning


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] backtracing of includes

2001-12-28 Thread Paul Burney

on 12/28/01 8:53 AM, Henning Sprang at [EMAIL PROTECTED] wrote:

 That's what I wrote - I know I can use things like that, but I am
 curious if there are other ways to find out which file is included by
 what and which function is defined in which file - i didn't find answers
 about that in the manual.

I'm not sure if there is anything built in that you can use, but you
probably should start with the:

__FILE__ and __LINE__

constants.  The __FILE__ constant is the name of the script file being
executed.  If it's in an include file, it will be the name of the include
file, not the parent file.  The __LINE__ is the current line within the file
(include).

HTH.

Paul Burney

?php
while ($self != asleep) {
$sheep_count++;
}
?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]