Do people still use the .inc extension?

Do people still use the .inc extension?

am 26.01.2008 23:31:23 von lister

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?

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.

Re: Do people still use the .inc extension?

am 27.01.2008 00:50:15 von RomZ

The reason lots of coders avoid using .inc extensions is following:
inc is displayed to the client browser as plain/text file and if you
store all your config files or any other php-related files in inc file
everyone is able to obtain an access to this file [yeah some people
will say there is .htaccess file to prevent folders\files from viewing
but if you'll forget to copy .htaccess while moving your site you'll
have a big security hole].

Re: Do people still use the .inc extension?

am 27.01.2008 03:12:02 von Jonas Werres

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

I don't even know why .inc has ever been a good idea.

Re: Do people still use the .inc extension?

am 27.01.2008 20:33:51 von junee

as RomZ stated, the main reason is, people can see your code in
browser if it is under web documents root and you have not set access
permission for the files.
Actually no benefit is getting by using .inc other than identifying
includes files, it can be done with grouping them in separate
directory.

Re: Do people still use the .inc extension?

am 27.01.2008 20:37:14 von Mason Barge

"lister" wrote in message
news:f0b80aff-a1e3-4269-b77c-8ee322441fb3@l32g2000hse.google groups.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?
>
> 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.

I use ".inc.php" and put the data inside php tags.

Re: Do people still use the .inc extension?

am 28.01.2008 00:39:02 von Michael Fesser

..oO(junu)

>as RomZ stated, the main reason is, people can see your code in
>browser if it is under web documents root and you have not set access
>permission for the files.

Such files don't belong there, period. If you can't store your include
files outside the document root, then get a better host.

>Actually no benefit is getting by using .inc other than identifying
>includes files, it can be done with grouping them in separate
>directory.

In my apps I prefer names like

TFoo.class.inc
IBar.interface.inc

It's simply a question of personal preference, nothing more.

Micha

Re: Do people still use the .inc extension?

am 29.01.2008 14:32:11 von colin.mckinnon

On 27 Jan, 19:37, "Mason Barge" wrote:
> "lister" wrote in message
>
> news:f0b80aff-a1e3-4269-b77c-8ee322441fb3@l32g2000hse.google groups.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.