devhelp / backup
Create backups using many filesystems
0.1.0
2015-02-10 22:19 UTC
Requires
- php: >=5.4.0
- league/flysystem: 0.5.*
- symfony/event-dispatcher: 2.6.3
Requires (Dev)
- henrikbjorn/phpspec-code-coverage: ~0.2
- phpspec/phpspec: ~2.0
- satooshi/php-coveralls: dev-master
This package is not auto-updated.
Last update: 2024-11-05 02:33:19 UTC
README
Purpose
This component provides backup functionality.
It uses Flysystem
component.
Instalation
composer require 'devhelp/backup:dev-master'
Usage
To set up connection between two Flysystem adapters please read documentation
Below you can find simple usage which creates backup between ftp location and locale filesystem:
use Devhelp\Backup\FlysystemBackupFactory; use Devhelp\Backup\Notification\NullNotification; use League\Flysystem\Filesystem; use League\Flysystem\Adapter\Ftp as FtpAdapter; use League\Flysystem\Adapter\Local as LocalAdapter; $sourceFilesystem = new Filesystem(new FtpAdapter(array( 'host' => 'example.com', 'username' => 'user', 'password' => 'secret' ))); $targetFilesystem = new Filesystem(new LocalAdapter('/target/directory')); $nullNotification = new NullNotification(); $backupManager = (new FlysystemBackupFactory($sourceFilesystem, $targetFilesystem))->create($nullNotification); $backupManager->runProcess();