| 
	
 | 
 Posted by Rory Browne on 06/02/05 11:31 
>  
> I do not agree. 
Not agreeing with Rasmus on a PHP list, can be seriously damaging to 
your credability, unless you really know what you're talking about and 
have a solid argument. 
 
Having that said, I personally use .inc.php  - .inc as Rasmus said, to 
denote include files, and .php because I couldn't be bothered 
configuring my editor, to syntax highlight .inc files. 
 
There are security arguments to be made for both approaches: 
 - .php (generally)means that any code is parsed as PHP - which 
generally means that it can't be read as source code. 
 - .inc (generally) means that it won't execute if it is called on its 
own, so even if it does contain code that shouldn't be run in 
isolation it won't be run. 
 
 - how about .inc.php.cgi? (: /me Ducks to avoid flamebashing.) 
 
Having that said, I'm about to make the same mistake, by 
disagreeing(sort of) with someone else on this list, who is generally 
right: 
 
 > (By the way, it's faster to specify an absolute path to your includes 
 > than to rely on include_path. You can save PHP the hassle of searching.) 
I see what you're saying, but the human time, you lose in keeping 
track where the include files are, and modding the code, any time it 
is moved would counteract his. 
 
Having that said, I suppose you could define an INCLUDES_DIR constant, 
and then include(INCLUDES_DIR . "/include.ext"). 
 
Alternatively if the include_path, contained the path that your 
includes were in, (and only the directory where you put your 
includes), then php wouldn't have very far to search.
 
[Back to original message] 
 |