PHP code example of heybigname / backup-manager
1. Go to this page and download the library: Download heybigname/backup-manager 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/ */
heybigname / backup-manager example snippets
// config/database.php
'development' => [
'type' => 'mysql',
'host' => 'localhost',
'port' => '3306',
'user' => 'root',
'pass' => 'password',
'database' => 'test',
],
'production' => [
'type' => 'postgresql',
'host' => 'localhost',
'port' => '5432',
'user' => 'postgres',
'pass' => 'password',
'database' => 'test',
],
// config/storage.php
'local' => [
'type' => 'Local',
'root' => '/path/to/working/directory',
],
's3' => [
'type' => 'AwsS3',
'key' => '',
'secret' => '',
'region' => Aws\Common\Enum\Region::US_EAST_1,
'bucket' => '',
'root' => '',
],
'rackspace' => [
'type' => 'Rackspace',
'username' => '',
'key' => '',
'container' => '',
'zone' => '',
'root' => '',
],
'dropbox' => [
'type' => 'Dropbox',
'key' => '',
'secret' => '',
'app' => '',
'root' => '',
],
'ftp' => [
'type' => 'Ftp',
'host' => '',
'username' => '',
'password' => '',
'root' => '',
'port' => 21,
'passive' => true,
'ssl' => true,
'timeout' => 30,
],
'sftp' => [
'type' => 'Sftp',
'host' => '',
'username' => '',
'password' => '',
'root' => '',
'port' => 21,
'timeout' => 10,
'privateKey' => '',
],
$manager = makeBackup()->run('development', 's3', 'test/backup.sql', 'gzip');
$manager = makeRestore()->run('s3', 'test/backup.sql.gz', 'development', 'gzip');
'BigName\BackupManager\Integrations\Laravel\BackupManagerServiceProvider',
use BigName\BackupManager\Manager;
public function __construct(Manager $manager) {
$this->manager = $manager;
}
$manager = App::make('BigName\BackupManager\Manager');