我已经创建了一组简单的类来实现它:https://github.com/outlandishideas/sync
在服务器上,例如example.com/remote.php:
const SECRET = '5ecR3t'; //make this long and complicated
const PATH = '/path/to/source'; //sync all files and folders below this path
$server = new \Outlandish\Sync\Server(SECRET, PATH);
$server->run(); //process the request
Run Code Online (Sandbox Code Playgroud)
在客户端:
const SECRET = '5ecR3t'; //this must match the secret key on the server
const PATH = '/path/to/destination'; //target for files synced from server
$client = new \Outlandish\Sync\Client(SECRET, PATH);
$client->run('http://example.com/remote.php'); //connect to server and start sync
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9227 次 |
| 最近记录: |