A simple PHP rsync wrapper library
Basic usage example:
use AFM\Rsync\Rsync;
$origin = __DIR__;
$target = "/target/dir/";
$rsync = new Rsync;
$rsync->sync($origin, $target);
Change behaviour:
use AFM\Rsync\Rsync;
$origin = __DIR__;
$target = "/target/dir";
$config = array(
'delete_from_target' => true,
'ssh' => array(
'host' => myhost.com,
'public_key' => '/my/key.pub'
)
);
$rsync = new Rsync($config);
// change options programatically
$rsync->setFollowSymlinks(false);
$rsync->sync($origin, $target);