Re: .INC files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux