albertofem / rsync-lib
简单的PHP rsync包装库
1.0.0
2018-01-13 20:13 UTC
Requires
- php: >=5.4
Requires (Dev)
- phpunit/phpunit: >=4.0,<6
This package is not auto-updated.
Last update: 2024-09-23 05:47:54 UTC
README
简单的PHP rsync包装库
要求
此库需要PHP >=5.4
变更日志
01-13-2018
- 放弃PHP 5.3支持
- 将
public_key
选项重命名为正确的private_key
。旧的仍然可以使用,将在2.0版本中弃用
安装
在composer中要求它
composer require albertofem/rsync-lib 1.0.0
安装它
composer update albertofem/rsync-lib
如果您想运行测试
./vendor/bin/phpunit
用法
基本用法示例
<?php use AFM\Rsync\Rsync; $origin = __DIR__; $target = "/target/dir/"; $rsync = new Rsync; $rsync->sync($origin, $target);
改变行为
<?php use AFM\Rsync\Rsync; $origin = __DIR__; $target = "/target/dir"; $config = array( 'delete_from_target' => true, 'ssh' => array( 'host' => 'myhost.com', 'private_key' => '/my/key' ) ); $rsync = new Rsync($config); // change options programatically $rsync->setFollowSymlinks(false); $rsync->sync($origin, $target);