gr8abbasi Posted May 18, 2010 Share Posted May 18, 2010 Hi, I want to install updates on the client system if any updates are available on the central server. So Please can anyone help me in retrieving the directories and files on central server, so that i can compare them with the clients version and if files on central server are updated then update the client files too..... So what will be the best solution for it? Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/202124-install-updates-on-client-system/ Share on other sites More sharing options...
gr8abbasi Posted May 18, 2010 Author Share Posted May 18, 2010 Is there anyone who can help me regarding this issue.......... Quote Link to comment https://forums.phpfreaks.com/topic/202124-install-updates-on-client-system/#findComment-1060040 Share on other sites More sharing options...
ignace Posted May 18, 2010 Share Posted May 18, 2010 I want to install updates on the client system if any updates are available on the central server. So Please can anyone help me in retrieving the directories and files on central server, so that i can compare them with the clients version and if files on central server are updated then update the client files too..... Use Subversion it will tell you exactly which files are updated since the last checkout. Quote Link to comment https://forums.phpfreaks.com/topic/202124-install-updates-on-client-system/#findComment-1060053 Share on other sites More sharing options...
gr8abbasi Posted May 19, 2010 Author Share Posted May 19, 2010 Thanks ignace for your reply, Is there any other way to do this using php? Quote Link to comment https://forums.phpfreaks.com/topic/202124-install-updates-on-client-system/#findComment-1060393 Share on other sites More sharing options...
trq Posted May 19, 2010 Share Posted May 19, 2010 PHP execute server side so no, your solution need to execute on the client. Quote Link to comment https://forums.phpfreaks.com/topic/202124-install-updates-on-client-system/#findComment-1060401 Share on other sites More sharing options...
greatstar00 Posted May 19, 2010 Share Posted May 19, 2010 the only way you can do is have a file version file in both client sever, and central server have the client (your visitors, the admin), load the current server's file version have a iframe to load central server's version in the iframe, use parent.document.getElementById("version")==document.getElementById("serverversion") Quote Link to comment https://forums.phpfreaks.com/topic/202124-install-updates-on-client-system/#findComment-1060412 Share on other sites More sharing options...
ignace Posted May 19, 2010 Share Posted May 19, 2010 the only way you can do is have a file version file in both client sever, and central server have the client (your visitors, the admin), load the current server's file version have a iframe to load central server's version in the iframe, use parent.document.getElementById("version")==document.getElementById("serverversion") I doubt he will be able to write his own version control system using something like Subversion is really his best option as all he'll have to do is: cd /path/to/web/root/ svn update You can use hooks but I do not recommend it as you don't want an unstable copy on the production server. Quote Link to comment https://forums.phpfreaks.com/topic/202124-install-updates-on-client-system/#findComment-1060428 Share on other sites More sharing options...
gr8abbasi Posted May 19, 2010 Author Share Posted May 19, 2010 Thanks for your replies. please can you tell me that how wordpress work for its updates. For example when we install the wordpress and if the updates are available then it show the link and process accordingly... Can you explain me how does it works for wordpress ? because i also want the similar functionality. if so plz provide me some example. thanks Quote Link to comment https://forums.phpfreaks.com/topic/202124-install-updates-on-client-system/#findComment-1060437 Share on other sites More sharing options...
ignace Posted May 19, 2010 Share Posted May 19, 2010 Depends how does WP do it's update? Automatic? Or does it just tell you there is a new update and refers you to the download site? Quote Link to comment https://forums.phpfreaks.com/topic/202124-install-updates-on-client-system/#findComment-1060462 Share on other sites More sharing options...
gr8abbasi Posted May 19, 2010 Author Share Posted May 19, 2010 @ignace: wordpress shows the link to update and on clicking that link it installs the updates while stays on your own site. So you never need to go to any site or anything else. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/202124-install-updates-on-client-system/#findComment-1060477 Share on other sites More sharing options...
ignace Posted May 19, 2010 Share Posted May 19, 2010 Most probably they contact an interface that communicates with the version control system and returns the updated files since your release version. Quote Link to comment https://forums.phpfreaks.com/topic/202124-install-updates-on-client-system/#findComment-1060479 Share on other sites More sharing options...
gr8abbasi Posted May 20, 2010 Author Share Posted May 20, 2010 plz can you give me some example, how it can be done... Thanks Quote Link to comment https://forums.phpfreaks.com/topic/202124-install-updates-on-client-system/#findComment-1060955 Share on other sites More sharing options...
dpacmittal Posted May 20, 2010 Share Posted May 20, 2010 PHP execute server side so no, your solution need to execute on the client. I think he means a web-app which can update on a single click or maybe auto-update using cron. @OP: You can create a php file on central server which simply echoes (or displays xml) latest version of software available. You can then use curl to download the archive on to client server, use zip libraries to extract the files and redirect the client-browser to upgrade.php or something. Quote Link to comment https://forums.phpfreaks.com/topic/202124-install-updates-on-client-system/#findComment-1060973 Share on other sites More sharing options...
ignace Posted May 20, 2010 Share Posted May 20, 2010 @OP: You can create a php file on central server which simply echoes (or displays xml) latest version of software available. You can then use curl to download the archive on to client server, use zip libraries to extract the files and redirect the client-browser to upgrade.php or something. I couldn't have said it better myself Quote Link to comment https://forums.phpfreaks.com/topic/202124-install-updates-on-client-system/#findComment-1061037 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.