[EMAIL PROTECTED] (Ryan A) wrote in
news:[EMAIL PROTECTED]: 

> Hi,
> A bit of a weird problem, am just curious if this can be done...
> 
> I have a file called config.inc.php which has a require_once in it for
> lang_a.php and
> lang_b.php
> 
> config.inc.php is being "included" by a.php and b.php
> 
> presently config.inc.php is doing a require_once for both lang_a and
> lang_b, is there any way to determine
> which file is calling the config.inc.php (a or b) and then set the
> require accordingly? I dont think so but am
> just wondering as PHP has a crapload of solutions that I would
> probably never know of.
> 
> Thanks,
> -Ryan
> 

Maybe you could check for the existence of a value which is set uniquely 
according to whether it is in lang_a or lang_b; set the value before the 
include then test in the included file to determine the action to be taken.

There are a couple of functions, get_included_files and get_required_files 
which might have some use to you - if not here, for future reference.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to