title: Mirror folder from remote server in pure PHP
body: <p>I want to keep a folder on one machine in sync with a folder on another. This is for a WordPress deployment plugin so I can't rely on rsync or other commands being present on either machine. PHP and a web server will be available on both machines and ideally it would work over HTTP.</p>
  
  <p>My current thinking is that the requesting machine posts the local file list with last modified dates to a script on the other machine. The other machine compares with its files and responds with the modified files - either a list of files to be fetched individually or with the changed files inlined in the response. </p>
  
  <p>I'd rather use an existing solution if one exists, though. Any ideas?</p>