Iank1968 Posted February 8, 2009 Share Posted February 8, 2009 I have a common.php file thats 4000 lines long and it boggs the server down big time. Can I use the $split function to break up the file and put less of a strain on the server when people play my game? I wasnt sure if I could post this here seeing its a VB function. I would appreciate any help on how to get this mamoth file into bite size pieces and still work. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/144367-do-i-use-split-to-split-my-commonphp-into-several-smaller-files/ Share on other sites More sharing options...
wildteen88 Posted February 8, 2009 Share Posted February 8, 2009 The size of the file (as in filesize or number of lines) has no affect on server load. However its the efficiently of the code that will have an affect. What do you have going on in common.php? Maybe there is something in there which is causing unnecessary load on the server. Quote Link to comment https://forums.phpfreaks.com/topic/144367-do-i-use-split-to-split-my-commonphp-into-several-smaller-files/#findComment-757554 Share on other sites More sharing options...
Iank1968 Posted February 8, 2009 Author Share Posted February 8, 2009 the code isnt that efficient being self taught. Would it be better to use something like php tidy? I thought it was the size of the file that was making things difficult. Quote Link to comment https://forums.phpfreaks.com/topic/144367-do-i-use-split-to-split-my-commonphp-into-several-smaller-files/#findComment-757558 Share on other sites More sharing options...
premiso Posted February 8, 2009 Share Posted February 8, 2009 php tidy will not help. Chances are you code has loops that are not necessary etc. Stuff that can be condensed down and made to work more efficiently. The size, as stated by wild, does not effect how fast the script runs. It is all about how it is coded. Quote Link to comment https://forums.phpfreaks.com/topic/144367-do-i-use-split-to-split-my-commonphp-into-several-smaller-files/#findComment-757564 Share on other sites More sharing options...
wildteen88 Posted February 8, 2009 Share Posted February 8, 2009 Prehaps attach common.php and we'll post suggestions on how to make your code cleaner/more efficient. Quote Link to comment https://forums.phpfreaks.com/topic/144367-do-i-use-split-to-split-my-commonphp-into-several-smaller-files/#findComment-757566 Share on other sites More sharing options...
Iank1968 Posted February 8, 2009 Author Share Posted February 8, 2009 ahh ok, I have 4000 lines to go threw and see where I messed up lol. the common.php file is for a game. you click an object in hopes to win a prize thats a rare. there are several common, and semi rares and 1 rare. There are 5 catagories and about 50 prizes, so I have alooooot to go threw, and not really sure what to look for. Quote Link to comment https://forums.phpfreaks.com/topic/144367-do-i-use-split-to-split-my-commonphp-into-several-smaller-files/#findComment-757567 Share on other sites More sharing options...
Iank1968 Posted February 8, 2009 Author Share Posted February 8, 2009 Do you want to see the common.php file? Quote Link to comment https://forums.phpfreaks.com/topic/144367-do-i-use-split-to-split-my-commonphp-into-several-smaller-files/#findComment-757568 Share on other sites More sharing options...
wildteen88 Posted February 8, 2009 Share Posted February 8, 2009 Do you want to see the common.php file? yes but attach the file to your post by clicking the Reply button. (bottom right of advertisement below). Quote Link to comment https://forums.phpfreaks.com/topic/144367-do-i-use-split-to-split-my-commonphp-into-several-smaller-files/#findComment-757570 Share on other sites More sharing options...
Iank1968 Posted February 8, 2009 Author Share Posted February 8, 2009 ok give me a couple minutes, and thank you very much Quote Link to comment https://forums.phpfreaks.com/topic/144367-do-i-use-split-to-split-my-commonphp-into-several-smaller-files/#findComment-757574 Share on other sites More sharing options...
Iank1968 Posted February 8, 2009 Author Share Posted February 8, 2009 how do I attach just the file to this? Quote Link to comment https://forums.phpfreaks.com/topic/144367-do-i-use-split-to-split-my-commonphp-into-several-smaller-files/#findComment-757579 Share on other sites More sharing options...
wildteen88 Posted February 8, 2009 Share Posted February 8, 2009 how do I attach just the file to this? Click reply button followed by clicking the Addition Options link under the reply box. Quote Link to comment https://forums.phpfreaks.com/topic/144367-do-i-use-split-to-split-my-commonphp-into-several-smaller-files/#findComment-757581 Share on other sites More sharing options...
Iank1968 Posted February 8, 2009 Author Share Posted February 8, 2009 here it is [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/144367-do-i-use-split-to-split-my-commonphp-into-several-smaller-files/#findComment-757597 Share on other sites More sharing options...
Q695 Posted February 8, 2009 Share Posted February 8, 2009 That's why I love includes, and functions quite a bit. It also saves a lot on the organic RAM, and CPU. Quote Link to comment https://forums.phpfreaks.com/topic/144367-do-i-use-split-to-split-my-commonphp-into-several-smaller-files/#findComment-757610 Share on other sites More sharing options...
Iank1968 Posted February 9, 2009 Author Share Posted February 9, 2009 any luck yet? Quote Link to comment https://forums.phpfreaks.com/topic/144367-do-i-use-split-to-split-my-commonphp-into-several-smaller-files/#findComment-757823 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.