Re: nested include_once()
| From: | Yasuo Ohgaki | Date: | Wed, 28 Nov 2001 11:56:54 +0000 |
| Subject: | Re: nested include_once() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-75882@lists.php.net to get a copy of this message | ||
Roko Roic wrote:
> If I use include_once() to include these files in main.php:
>
> main.php
> ---------
> include_once('lib.php');
> include_once('service.php');
> ---------
>
> And file service.php also has a line in it:
>
> service.php
> ----------
> include_once('lib.php');
> ----------
>
> Will lib.php get included twice or only _once() ?
>
> I am wondering because get_included_files() acts kind of 'strange' and does
> not display files included from included files. Damn recursion :)
include_once() include files once. Next include_once() looks up
hash and if file is already included, PHP does not include.
>
> [OT] Is there a way to tail files that get read from a Linux filesystem.
> That could help me find out what gets included and when?
I'm not sure why tail function is useful. Anyway, you can use
get_included_files()/get_requried_files() to know which files are
included/required.
--
Yasuo Ohgaki