Click to See Complete Forum and Search --> : php include file


adnan1983
02-04-2004, 04:03 PM
my boss wants me to write an include file, with all the function the application is going to use. The include is already over 2700 lines of code. I hate doing in such a method, I like having different include files for different sections.

How do you guys write your code?

daynah
02-04-2004, 04:12 PM
I usually write them in classes and then include those files when I need them. Splitting them up into files/classes is easier to comprehend, especially when I don't look at the code for months.

adnan1983
02-04-2004, 04:14 PM
yeah, I know splitting them up into different files/classes will be much easier. But he wants me to do in one big file, and then use that include file.

ednark
02-21-2004, 06:44 PM
well an include file can always incude an include file


so... you can have one main one to include on each page... and then have that call each sub include

Weedpacket
02-21-2004, 08:43 PM
I've seen situations where each function was in its own include file; every function that called others used include_once() to load just those other functions. I don't know how good an idea that is in general: it was being used in a situation where standalone apps were being generated from the code in the library, and it was necessary that only the code that was actually used in any given application would be included. There was also a tool for tracking these include() dependencies.