One script for everyone, or to each his own?

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
User avatar
zeek
Forum Commoner
Posts: 48
Joined: Mon Feb 27, 2006 7:41 pm

One script for everyone, or to each his own?

Post by zeek »

I have written a shopping cart application customized my clients' nitche industry. The php scripts will be the same for every web site that uses the cart (I host them all). My question is this:

Is it better to install one set of scripts on my server that all sites use, or to install a seperate set of scripts for each virtual account (user)?

I'd like to be able to use a single set of scripts, for easy upgrading, etc., but is there a disadvantage to this method?

Thanks in advance. NOTE: The application is just straight PHP/mySQL.
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

In this case, it's definately better to put it on your server and have them use it off your hosting. I built a shopping cart as well for my company, and that is how we host it for all 1200+ of our stations.

It just makes for easier debugging and also for easier management. If you spread those files everywhere, you will have a whole galaxy of issues, mainly having to update the exact same problem on every single machine you put your code on.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

For me it depends on whether the code is changing very much. If it is very stable then central is better. If it is part of a common application where upgrades will happen to all sites then common is better.

You can also have the both configurations if you have the search path set to "." and then "/path/to/common/libs" because it will find the local copy first if it exists and override the common files.
(#10850)
User avatar
zeek
Forum Commoner
Posts: 48
Joined: Mon Feb 27, 2006 7:41 pm

Thank you

Post by zeek »

Thank you both for your replies. That's what I needed to know.
User avatar
PrObLeM
Forum Contributor
Posts: 418
Joined: Sun Mar 07, 2004 2:30 pm
Location: Mesa, AZ
Contact:

Post by PrObLeM »

may i suggest symlinks to the file.
Post Reply