PHP code example of devhelp / backup

1. Go to this page and download the library: Download devhelp/backup library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

devhelp / backup example snippets


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