PHP code example of backup-manager / symfony

1. Go to this page and download the library: Download backup-manager/symfony 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/ */

    

backup-manager / symfony example snippets


// config/bundles.php

return [
    BM\BackupManagerBundle\BMBackupManagerBundle::class => ['all' => true],
    // ...
];


class Foo {
  private $backupManager;

  public function __construct(BackupManager $backupManager) {
      $this->backupManager = $backupManager;
  }

  public function bar() {
      $this->backupManager->makeBackup()->run('development', [new Destination('s3', 'test/backup.sql')], 'gzip');
  }
}

class Foo {
  private $backupManager;

  public function __construct(BackupManager $backupManager) {
      $this->backupManager = $backupManager;
  }

  public function bar() {
      $this->backupManager->makeRestore()->run('s3', 'test/backup.sql.gz', 'development', 'gzip');
  }
}