I was wondering if people could share their expertise and opinions on the best solution to a potential problem. I won't go in to specific details, just the theory of what our plans are. What we are planning to develop at work is a website in which we can sell other websites to buyers. Then we can manage these websites centrally from one place which will apply updates to all of these websites. E.g. If we add an additional function such as feeding products to Google Shopping which we want to be addded to all of the websites admin area. E.g. Want to add a video or advertisment to all of the 'child' websites from the 'parent' central website. Has anyone got any ideas how this could work? I know previously having worked at a different company as a designer they achieved this with an eCommerce system and added to its functionality overtime to clients who already purchased the eCommerce system. They applied updates to central server files which processed all of the websites below's payments and other features. So far I can think this could possibly be done with: - file includes centralised database combo of the 2 Please can people help with me tech solutions? Thanks
if these functions need server side code, and assuming that child websites aren't on the same server ( don't share the sources ) you could achieve this by having an update function on every child website that checks for updates against your main server, if an update has been released then the new files are fetched and saved to the client website, scripts are executed, databases gets updated etc ( it's pointless to go in details here as everybody would develop this differently ). This requires a lot of planning as you should prepare update functions for every aspect of the client website. ( download files, update database structure, set up new crons, etc etc ) in case you just want to add ads or videos you can simply have client websites fetch an xml/csv feed and display its contents ( but again, this can be developed in many different ways )
Thanks, Could you give me any example of how this might be achieved in PHP? I know what needs to be done, but just what functions or direction i should take in order to achieve the desired effect. The advertisements could be done through XML or RSS feed which is a good idea and I may adopt this idea in development. Thanks Any other suggestions?
Hi, This can be easily added.Just use file_get_contents function of PHP and encode that file so that user can not remove it from script. Hope this will help you thank you
Ah ok, so if i use file_get_contents to retieve a PHP processing file that may process a payment option for example. How can I ensure that security is maintained? Any ideas?
This is not trivial if it is to be done right. Optionally, your core product should be modular and you need to have an API to use / update / add remove those module. BIG FUSS, needs good design from the beginning.
yes, this is something that needs to be planned in advance, at least if your system is a bit complicated. By the way, at a certain level this can be implemented sticking to a rather simple procedure - check for updates - download and eventually replace files - execute sql to update the db if necessary - schedule crons, or add instructions to the db ( if crons just pull instructions from the db ) this can be done with any website structure, modular or non modular
I understand this principle, but can you give me some examples of how i can ask each client website to check for updates? and how i go about sending updates to each websites? How to update the files if an update is present etc etc. I just want to have a rough plan to go by before I start planning out how it will work.
each client website needs to have a scheduled cronjob that checks every day for available updates. Let's say this cron loads a file on your website named whatever.xml ( or any other format, how to implement the details is totally up to you ) this file contains the current version number, the address where all the files ( or just those that need to be changed ) can be downloaded, the address of an SQL file that needs to be executed. Having the cron already scheduled on all the clients makes it easy for the central server to deliver the update: once you release a new version via the xml file you already know that within 24 hours all the clients will try to update themselves. Remember that you need to check from which version your clients are updating and deliver different files and sql files, otherwise a client updating from 1.2 to 1.3 would get its website update and running smoothly, someone updating from 1.1 to 1.3 would probably get all his files and database screwed. If the cron finds out that a new version is the current one then it will proceed to download the files, update those on the client server and execute any provided sql instructions. As I already said the implementation is totally up to you, this is just a way how it can be done. Easier said than done, obviously.