Re: Inc/Require within includes

From: Date: Wed, 23 Aug 2000 07:18:27 +0000
Subject: Re: Inc/Require within includes
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-13099@lists.php.net to get a copy of this message
I don't use require.. as it tends to lead to problems (but that is another issue). Have you tried this same thing with includes? Happy note: I also have began doing this: at the top of every include file, I do this: define('FILENAME_INC',1); and then whenever I need to include filename.inc, I do this... if (!defined('FILENAME_INC')) include('filename.inc'); The idea is completely ripped from #ifndef type defines typical in C source code. It has made life much easier, especially with multiple people working on the same code, to not have to worry about reincluding a file (because php will bitch if you do). -jeremy brand _______________________________________________________________________ GnuPG Fingerprint: 9F5E 95E0 1CC2 E054 84EA 6099 8ACD 9DBA D2C0 5EA9 _ http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more __ > E.G. > > <?php > require "required1.inc"; > ?> > > ---- and in required1.inc > <?php > require "required2.inc"; > ?> > ---------- > > When I try to do this, I get a "Fatal error when opening required2.inc in > required1.inc". > > Is there any way to get around this problem? Or am I doing something wrong? > Is having two nested required files a big no-no? > > -Antonio > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#13099) next »