Forum Moderators: coopster

Message Too Old, No Replies

Include all "includes" at once

logic?

         

henry0

7:35 pm on Jun 26, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I start to have too many includes for this.. require for that... classes etc...

is there a way to somehow doing something like ref to a DOC_ROOT and make a whole package always available
but without typing and typing again all the includes, requires etc.

Funny thing is while developing one may find a need for something that one has no clue on implementation :)

SixTimesEight

7:41 pm on Jun 26, 2007 (gmt 0)

10+ Year Member



I usually have a file like 'main.php' that includes everything else. That way I can just include 'main.php' first thing on each page.

hawkerz

7:42 pm on Jun 26, 2007 (gmt 0)

10+ Year Member



you could put all your includes and requires in a seperate file and just include that file ;) OOP works nicely always

henry0

8:03 pm on Jun 26, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks but that would be thousands of lines to read per each call to that file.
what I am looking for is to set the bulk of those files in a dir
and find a system to make available those files available once for all.
I have seen something like that
too bad did not copy it :)

Habtom

5:03 am on Jun 27, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Henry,

:) Have you come across of this thread Top 100 Signs That I Am Writing Spaghetti Code in PHP [webmasterworld.com].

Habtom

henry0

11:19 am on Jun 27, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't mind; I've got a good tomato sauce :)
Care to share?

henry0

11:37 am on Jun 27, 2007 (gmt 0)

Habtom

11:42 am on Jun 27, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've got a good tomato sauce :)
Care to share?

why not? :)

Nice link, tnx.

Habtom

I just found out it was written by a sleepless person :)

John Coggeshall is a PHP consultant and author who started losing sleep over PHP around five years ago. Lately you'll find him losing sleep meeting deadlines ...

[edited by: Habtom at 11:55 am (utc) on June 27, 2007]