Re[2]: [PHP] Include file questions

2007-05-25 Thread Richard Davey
Hi Tijnema,

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

 On 5/25/07, Robert Cummings [EMAIL PROTECTED] 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.

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
-- 
Zend Certified Engineer
http://www.corephp.co.uk

Never trust a computer you can't throw out of a window

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



Re: Re[2]: [PHP] Include file questions

2007-05-25 Thread Tijnema

On 5/25/07, Richard Davey [EMAIL PROTECTED] wrote:

Hi Tijnema,

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

 On 5/25/07, Robert Cummings [EMAIL PROTECTED] 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



Re[2]: [PHP] Include file

2005-03-30 Thread Richard Davey
Hello Jay,

Wednesday, March 30, 2005, 10:14:27 PM, you wrote:

JB I try to use both types of quotes in the proper circumstance.
JB Having said that, I came to computing in the age where we worried
JB over CPU cycles, but I don't see how in this day and age the
JB difference between the two would even matter. Even on a high load
JB site the difference between the two would be negligible.

I agree it's going to be negligible, but even so the difference does
exist. The real question is which is faster between:

include path/$file

and

include 'path/' . $file

Can the compiler handle the in-line variables quicker than string
concatenation? It'll take a C guru who knows the PHP code well to
answer this fully.

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 I do not fear computers. I fear the lack of them. - Isaac Asimov

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