Jump to content

what function do I use to split a rather large common file?


Iank1968

Recommended Posts

I want to split my common.php into 2 smaller files and still be read by the common.php file. Someone told me how to awhile ago but I cant find the thread. I also understand that splitting the file into 2 smaller files eleviates some strain on the server, is that true?

as far as i understand, splitting files does not have anything to do with server strain. The code is anyways going to be executed if u include them.

 

For splitting it is entirely developers decision whether to split them into 2 or more files and how to do that. you can just put some code in functions and copy the functions in another file, include it and use the functions.

wel the code Iam using is a game, and when several people play it at the sametime my server goes nuts and crashes. server goes from 2 to 13 and crashes. most of it isnt my code and the guy who wrote the code isnt around anymore. Its probably way to mush to ask someone to actually go threw it and recommend ways to streamline it and find where the loops is thats causing the crashes, if thats what it is. I was told that splitting the file puts less strain on the server, but I wanted to ask here about that claim.

samshel is right... When you include files, it is like copying and pasting all of the code that is included right where the include statement is, so for your benefit they are in two files, but the parser sees it as one big file. I would say it is time for a stronger server :)

Well, it is possible to split an include in such a way that only half is included in some places, thus decreasing the strain on the server. It really depends on what's being included.

 

I would say it is time for a stronger server :)

 

Or some refactoring :P

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.