I am working on an application that will be deployed on multiple servers. In order to simplify the process by which the software is upgraded, I'm looking to develop a script that the client (local server) would run to update all of the local scripts. This may also be set up as an overnight cron job.
I would like to code written in php that would do the following:
1. Scan a list of files on the local server and obtain the date/time of their most recent update. There would be a set list of files to be queried.
2. Authenticate to a remote server as a unique user (i.e. some type of authentication code would need to be sent and compared to acceptable codes on the remote server. That code will only work for a request coming from a specific IP address and URL. This would thus restrict people from passing their code to someone else to download the scripts).
3. Compare the local file to the remote file. If the remote is newer, then grab it's contents and update the local file.
Most of the files that will be updated on the local server will be .php files and in some cases a .js file.
What I'm looking for is pretty much described in this post:
[url removed, login to view]