Re: good practice

From: Date: Fri, 15 Feb 2002 15:34:25 +0000
Subject: Re: good practice
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-84917@lists.php.net to get a copy of this message
On Thursday, February 14, 2002, at 04:40 PM, Michael Kimsal wrote:
On that same topic, *why* do people name files with both .inc and .php? Your .inc file has PHP code in it, right? Why not just call it .php and spare the server reconfiguration. If knowing which files are "include" files (long time since I've made that distinction!) just prepend them with inc_ or put them all in an includes/ directory.
If you are including a file into another file with PHP's 'include()' function, it doesn't matter what the extension is. You don't even need an extension. Apache doesn't even see this as a separate file, it thinks of it all as one big file with the name of whichever file is doing the including. Giving the .inc suffix is a nice way to keep your code organized. Also, I keep my .incs in a separate directory. Not to mention I have a directive in my server's conf file that specifically prevents it from serving any file with the extension '.inc'. Erik ---- Erik Price Web Developer Temp Media Lab, H.H. Brown pricee@hhbrown.com

« previous php.general (#84917) next »