You are here: Re: Do people still use the .inc extension? « PHP Programming Language « IT news, forums, messages
Re: Do people still use the .inc extension?

Posted by C. (http://symcbean.blogspot.com/) on 01/29/08 13:32

On 27 Jan, 19:37, "Mason Barge" <masonba...@comcast.net> wrote:
> "lister" <listerofsme...@hotmail.com> wrote in message
>
> news:f0b80aff-a1e3-4269-b77c-8ee322441fb3@l32g2000hse.googlegroups.com...
>
> >I have developed my site using .inc as the extension for include
> > files, but I recently read in a book that this is somewhat obsolete
> > now?
>

A book that says you should do / not do certain things but doesn't
explain why? Not a good book.

> > Is this true? Do people just use .php for everything now? It would
> > help with my editing tools as none of them recognise .inc as php so
> > the colour contexts are messed up and some tools don't work.

So that's one reason - but....

>
> I use ".inc.php"

Me too - it means I can see at a glance what a file does, it solves
the editor problem. My coding style goes further though - any include
file within the document root should have no 'main' section (i.e. only
defines, class and func defs) unless it explicitly returns a value
(and even then it should *never* generate any output unless a class or
method is called). If I *must* write an include file which does not
follow these rules then it goes outside the webroot.

The reason for this is to prevent any unplanned disclosure of the code
- because if someone manages to find the URL for these files, then
they will be processed by the PHP parser rather than returned directly
to the browser. It also prevents accidents of code being called out of
its correct context.

C.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация