[PHP] Need help with auto_prepend_file

2001-09-24 Thread Michael Champagne

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



**
This communication is for informational purposes only.  It is not
intended as an offer or solicitation for the purchase or sale of 
any financial instrument or as an official confirmation of any 
transaction, unless specifically agreed otherwise.  All market 
prices, data and other information are not warranted as to 
completeness or accuracy and are subject to change without
notice.  Any comments or statements made herein do not 
necessarily reflect the views or opinions of Capital Institutional
Services, Inc.  Capital Institutional Services, Inc. accepts no
liability for any errors or omissions arising as a result of
transmission.  Use of this communication by other than intended
recipients is prohibited.
**

-- 
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] Need help with auto_prepend_file

2001-09-24 Thread * RzE:

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

-- 

* RzE:


-- 
-- 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]