devhelp/backup

Create backups using many filesystems

0.1.0 2015-02-10 22:19 UTC

This package is not auto-updated.

Last update: 2024-11-05 02:33:19 UTC


README

Build Status Coverage Status Scrutinizer Code Quality SensioLabsInsight

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();