2017 © Pedro Peláez
 

library backupl41

An easy way backup and restore databases in Laravel.

image

h2akim/backupl41

An easy way backup and restore databases in Laravel.

  • Friday, July 3, 2015
  • by h2akim
  • Repository
  • 1 Watchers
  • 1 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 8 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

An easy way backup and restore databases in Laravel.

Fork from Cornford/Backup * Add Laravel 4.1 Support, (*1)

Think of Backup as an easy way to backup and restore a database, with command line integration to Laravel's artisan. These include:, (*2)

  • Backup::export
  • Backup::restore
  • Backup::setBackupEngineInstance
  • Backup::getBackupEngineInstance
  • Backup::setBackupFilesystemInstance
  • Backup::getBackupFilesystemInstance
  • Backup::setEnabled
  • Backup::getEnabled
  • Backup::setPath
  • Backup::getPath
  • Backup::setCompress
  • Backup::getCompress
  • Backup::setFilename
  • Backup::getFilename
  • Backup::getWorkingFilepath
  • Backup::getRestorationFiles
  • Backup::getProcessOutput

Installation

Begin by installing this package through Composer. Edit your project's composer.json file to require cornford/backup., (*3)

"require": {
    "h2akim/backup": "dev-master"
}

Next, update Composer from the Terminal:, (*4)

composer update

Once this operation completes, the next step is to add the service provider. Open app/config/app.php, and add a new item to the providers array., (*5)

'H2akim\Backup\Providers\BackupServiceProvider',

The next step is to introduce the facade. Open app/config/app.php, and add a new item to the aliases array., (*6)

'Backup'         => 'H2akim\Backup\Facades\Backup',

Finally we need to introduce the configuration files into your application., (*7)

php artisan config:publish h2akim/backup

That's it! You're all set to go., (*8)

Usage

It's really as simple as using the Backup class in any Controller / Model / File you see fit with:, (*9)

Backup::, (*10)

This will give you access to, (*11)

Export

The export method allows a database export file to be created in the defined backup location, with an optional filename option., (*12)

Backup::export();
Backup::export('database_backup');

Restore

The restore method allows a database export file to be restored to the database, specifying a full filepath to the file., (*13)

Backup::restore('./database_backup.sql');

Set Backup Engine Instance

The setBackupEngineInstance method allows a custom backup engine instance object to be utilised, implementing the BackupEngineInterface., (*14)

Backup::setBackupEngineInstance(new BackupEngineMysql(new BackupProcess(new Symfony\Component\Process\Process), 'database', 'localhost', 3306, 'root', '', []));

Get Backup Engine Instance

The getBackupEngineInstance method returns the current backup engine instance object., (*15)

Backup::getBackupEngineInstance();

Set Backup Filesystem Instance

The setBackupFilesystemInstance method allows a custom backup filesystem instance object to be utilised, implementing the BackupFilesystemInterface., (*16)

Backup::setBackupFilesystemInstance(new BackupFilesystemInstance);

Get Backup Filesystem Instance

The getBackupFilesystemInstance method returns the current backup filesystem instance object., (*17)

Backup::getBackupFilesystemInstance();

Set Enabled

The setEnabled method allows backup to be switched on or off, specifying a boolean for state., (*18)

Backup::setEnabled(true);
Backup::setEnabled(false);

Get Enabled

The getEnabled method returns the current backup enabled status, returning a boolean for its state., (*19)

Backup::getEnabled();

Set Path

The setPath method allows backup location path to be set, specifying a relative or absolute path as a string, a trailing slash is required., (*20)

Backup::setPath('/path/to/directory/');

Get Path

The getPath method returns the current absolute backup path in string format., (*21)

Backup::getPath();

Set Compress

The setCompress method allows backup file compression to be switched on or off, specifying a boolean for state., (*22)

Backup::setCompress(true);
Backup::setCompress(false);

Get Compress

The getCompress method returns the current compression backup status, returning a boolean for its state., (*23)

Backup::getCompress();

Set Filename

The setFilename method allows backup filename to be set, specified in a string format., (*24)

Backup::setFilename('database_backup');
Backup::setFilename('backup-' . date('Ymd-His'));

Get Filename

The getFilename method returns the current set backup filename in a string format., (*25)

Backup::getFilename();

Get Working Filepath

The getWorkingFilepath method returns the current set working filepath of the current item being processed in a string format., (*26)

Backup::getWorkingFilepath();

Get Restoration Files

The getRestorationFiles method returns an array containing all of the restoration file filepaths within a give path, an optional absolute path can be set as a string., (*27)

Backup::getRestorationFiles();
Backup::getRestorationFiles('/path/to/directory/');

License

Backup is open-sourced software licensed under the MIT license, (*28)

The Versions

03/07 2015

dev-master

9999999-dev

An easy way backup and restore databases in Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Bradley Cornford
by Hakim Razalan

database laravel backup dump restore

30/06 2015

dev-develop

dev-develop

An easy way backup and restore databases in Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Bradley Cornford

database laravel backup dump restore

30/06 2015

v1.0.0

1.0.0.0

An easy way backup and restore databases in Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Bradley Cornford

database laravel backup dump restore