cmgmyr Posted January 30, 2007 Share Posted January 30, 2007 Hey all,I've been working on my www.syracusebands.net site for over a year now and over that time I have made a lot of improvements and have also gotten a lot of the same type of work from it (other membership sites). Initially I had the whole members script in one file which was about 8,000+ lines of code and it was running really slow. It was pretty much one big switch that would point you to differnet functions within the same users page. When I did an upgrade I took all of those functions and made other files and "included" them when you call that function. This cut down the users script to about 475 lines of code so the site is a LOT faster now. I would like to take the next step in programming to make myself and my scripts better. I was thinking about converting it to OOP. What are your thoughts? And is there something else I should look into?Thanks,-Chris Quote Link to comment https://forums.phpfreaks.com/topic/36366-membership-programming-style-opinion/ Share on other sites More sharing options...
ober Posted January 30, 2007 Share Posted January 30, 2007 First off... nice looking site! It's improved 10 fold since I saw it last! :)The only thing I can really suggest is going back through the code to see if you can optomize anything. Without seeing what it does exactly, it's hard to tell what exactly would help or hinder by moving it to an OOP approach.I'll give you an example of how I manage one of my bigger projects (my own CMS):I have a single class that handles user administration... but it also handles displaying different content, etc. The main piece of it is nothing more than a switch that is defined for specific items (login, logout, forgotpass, etc) and then the default action is to include a specific module. The code looks in a table in a database to see what javascript, php, and css files might be need for that module and pulls it all in. I have close to 15 modules now and probably several thousand lines of code when it's all combined. I don't see any performance issues and I think it's because of the same issues you were seeing. Keep in mind that everytime PHP has to parse a large file, it has to load all that into memory. Going with your current method, it just loads the "directions" to the content that it needs to load.I think your current approach sounds pretty good and I doubt you'd see a performance boost otherwise. Quote Link to comment https://forums.phpfreaks.com/topic/36366-membership-programming-style-opinion/#findComment-172984 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.