<Original message>
From: Michael Champagne <[EMAIL PROTECTED]>
Date: Mon, Sep 24, 2001 at 09:28:01AM -0500
Message-ID: <[EMAIL PROTECTED]>
Subject: [PHP] Need help with auto_prepend_file
> Our website relies heavily on include files. We have a single include file
> that is 'auto prepended' to every php file on the site using the
> auto_prepend_file directive in php.ini. This include file does an
> include_once on other include files. Also, most parts of our code include
> other page components such as our menu bar from other .inc files.
>
> Should we be using auto_prepend_file? It seems like this does not do an
> include_once and when we turn error_reporting = E_ALL we are seeing a lot of
> errors on variables that have already been defined and such.
>
> Thanks in advance for any replies.
>
> Mike
</Original message>
<Reply>
What you can do is check on some constant that you define the first
time the file is included. The auto prepended file will then look
something like:
--- Pseudo code ---
- if constant A is not defined
-- define constant A
-- your code
--- End of Pseudo code ---
This will make sure function, variables and/or constants will only
be defined once.
</Reply>
--
* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»»
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- ««««««««««««««««««««««««
--
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]