Page 1 of 1

Thinking aloud: Assets/Class Management?

Posted: Fri Aug 03, 2007 6:02 am
by dillion
Was just thinking as I completed yet another client website whether it would makes sense to "centralise" all common classes, javascripts, etc.

So basically, if you have 4 separate websites (could be hosted on the same or separate servers) and each website uses the same class (e.g. Swiftmailer, RSS, security, etc.). If in future, I need to upgrade these classes for reasons like bug fixes, improvements, etc., I would need to remember to deploy the classes for each website.

My thoughts:
  1. Develop a mySQL database to contain all client details including their web URLs, etc.
  • Develop a "master" website (e.g. non-client)
  • Add all relevant assets to a specific folder (e.g. "client_assets")
  • On each client website, instead of doing an include_once, use cURL or something similar to load in now-external required files
  • The database on the master website could be used to check where the request is coming from
The database could also be used to deactivate a website if a client starts making trouble. :D

So if I need to replace or upgrade a class, I just need to do it once on the master website.

What are your thoughts?

Posted: Fri Aug 03, 2007 7:36 am
by kyberfabrikken
A version control system is probably a better solution to this.

Posted: Fri Aug 03, 2007 3:41 pm
by Christopher
I think there is some confusion between "website" and "server". If the websites share common code and just have different images and database entries, then putting them on the same server might make more sense.

Posted: Tue Aug 07, 2007 5:40 pm
by thinsoldier
yea if you've used version control for anything else before than that would be a good way to go

But I dont know crap about svn so I sort of do it the way you describe.
Difference being I didnt think about the central database part but I know of a team of really good devs who do it that way for all their real estate sites but then just use include_once instead of curl and have a common variable defined in each site's config file to indentify which client site is requesting stuff.

Don't realy have a 'master' site tho. We've got a test site where the more complex and prone to breakage features of other sites are copied to so we can mess with them if we need to figure out how to fix or improve something and then there's a dummy site directory where if we need to change a core class that may break every site that needs it we just copy the file there and mess with the copy and a copy of a live site until I'm sure it's fixed. Then just copy it back.

Posted: Wed Aug 08, 2007 2:42 am
by kyberfabrikken
thinsoldier wrote:yea if you've used version control for anything else before than that would be a good way to go
I think version control systems tend to seem mystical to those who haven't used them before, but it's really not much different from using an FTP-client. You update files, you check them in. If you add a file or delete it, you need to do it through SVN, but that's about it. There are some advanced features, but you don't need to deal with those from the start -- They are mostly aimed at large groups any way, and thus rather irrelevant for a single developer.