Re: Re[2]: Include file questions

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

 



On 5/25/07, Richard Davey <rich@xxxxxxxxxxxxx> wrote:
Hi Tijnema,

Friday, May 25, 2007, 5:58:46 PM, you wrote:

> On 5/25/07, Robert Cummings <robert@xxxxxxxxxxxxx> wrote:
>> Very. Each directory contains very specific types of code/content.
>> Tracking down where any given function, class, custom tag, behaviour,
>> etc is defined is extremely simple.
>>
>> Cheers,
>> Rob.

> I don't agree with you, i have includes in includes dir inside my
> project, images in images, etc. classes in includes dir start with
> class. configuration files in includes start with config. etc.

Oh to work on such little sized sites again :)

Not that I'm belittling your projects Tijnema, because I'm not - but
I've not worked on a site with a structure that could be that simple
for a long time now, I kinda miss it actually!! Hell even the 'images
folder' had to be split across multiple servers in the code I finished
today.

I have actually very big projects, with hundreds of PHP files in the
includes folder. I just give them a logical name and it works for me,
so if I have for example about 10 scripts(classes) that all relate to
file handling, I name them like this
class.file.open.php
class.file.close.php
class.file.read.php
class.file.write.php
Of course this is just an example, as you don't need a seperate class
for file opening.., but you got the point of my file naming now. With
this I don't have any problems having 100s of php files in one
directory.



A lot of Robert's structure makes complete sense. I never keep
libraries inside the webroot that simply don't need to be there.
Infact if a script doesn't output anything 'web related' (image, rss,
html) or process data from the site, it doesn't need to live in the
webroot at all. I use a similar principal for the 'admin' area of the
site too, which I'm sure you'd hate ;) but I always code my admin
areas so that they can run on an entirely different domain name and/or
server if needs be. Only as a last resort do they ever live in /admin,
and never will they share libs that the 'public' site uses, they are
entirely stand-alone entities.

You're right in that it is down to personal preference though :)

Cheers,

Rich

It doesn't need to be there, but I like to have all files for a
project in a single folder. And what does make the difference if it
doesn't output anything?

Tijnema

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