clear01 / rsync-lib
Fork of a simple PHP rsync wrapper library by Alberto Fernandez
Installs: 137
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 30
pkg:composer/clear01/rsync-lib
Requires
- php: >=5.3.3
Requires (Dev)
- phpunit/phpunit: ~4.1
This package is not auto-updated.
Last update: 2025-10-04 00:43:21 UTC
README
A simple PHP rsync wrapper library
Installation
Require it in composer:
composer require albertofem/rsync-lib dev-master
Install it:
composer update albertofem/rsync-lib
If you want to run the tests:
./vendor/bin/phpunit
Usage
Basic usage example:
<?php use AFM\Rsync\Rsync; $origin = __DIR__; $target = "/target/dir/"; $rsync = new Rsync; $rsync->sync($origin, $target);
Change behaviour:
<?php 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);