flamecore / synchronizer-files
同步本地和远程文件系统
dev-master
2017-09-28 14:59 UTC
Requires
- php: >=5.4
- flamecore/synchronizer: ~0.1
- league/flysystem: ~1.0
- symfony/filesystem: ~2.6
Requires (Dev)
- phpunit/phpunit: 4.5.*
- scrutinizer/ocular: ~1.1
This package is auto-updated.
Last update: 2024-09-05 01:26:07 UTC
README
这个库使同步本地和远程文件系统变得容易。
FilesSynchronizer 是作为部署和测试工具 Seabreeze 的后端开发的。它以我们自开发的 Synchronizer 库为基础。
入门
包含供应商自动加载器并使用类
namespace Acme\MyApplication; use FlameCore\Synchronizer\Files\FilesSynchronizer; use FlameCore\Synchronizer\Files\Location\LocalFilesLocation; require 'vendor/autoload.php';
创建您的 Source
和 Target
对象
$source = new LocalFilesLocation(['dir' => $sourcePath]); $target = new LocalFilesLocation(['dir' => $targetPath]);
创建 FilesSynchronizer
并分配 Source
和 Target
$synchronizer = new FilesSynchronizer($source, $target); $synchronizer->observe($observer); // optionally set an EventObserver object
现在开始同步您的文件
$synchronizer->synchronize(); $synchronizer->synchronize(false); // Do not preserve obsolete files
安装
通过 Composer 安装
如果您系统上尚未安装 Composer,请安装 Composer。
要安装库,请运行以下命令,您将获得最新的开发版本
$ php composer.phar require flamecore/synchronizer-files:dev-master
要求
- 您必须在系统上至少安装 PHP 版本 5.4。
贡献者
如果您想贡献,请先查看 CONTRIBUTING 文件。
感谢贡献者
- Christian Neff (secondtruth)