Jump to content

Recommended Posts

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
Link to comment
https://forums.phpfreaks.com/topic/36366-membership-programming-style-opinion/
Share on other sites

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.
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.