From d48ec3314acfc48ff8d50352c1f2cedf2cb6b453 Mon Sep 17 00:00:00 2001 From: Devon Zara Date: Sat, 6 Feb 2016 05:49:27 +0000 Subject: [PATCH 01/37] Update for Symfony 3 components --- src/AutoComplete.php | 39 +++++++++++++++++++++++++++++++++- src/Laravel4Compatibility.php | 12 ++++++++++- src/Laravel50Compatibility.php | 12 ++++++++++- src/Laravel51Compatibility.php | 12 ++++++++++- 4 files changed, 71 insertions(+), 4 deletions(-) diff --git a/src/AutoComplete.php b/src/AutoComplete.php index e9d8add..bde69f1 100644 --- a/src/AutoComplete.php +++ b/src/AutoComplete.php @@ -1,7 +1,11 @@ useSymfontDialog($dialog, $list, $default, $validation); + } catch (InvalidArgumentException $error) { + // + } finally { + return $this->useSymfonyQuestion($dialog, $default, $validation); + } + } + + /** + * @param $dialog + * @param array $list + * @param null $default + * @return mixed + */ + protected function useSymfontDialog($dialog, array $list, $default = null, $validation) { $helper = $this->getHelperSet()->get('dialog'); - return $helper->askAndValidate($this->output, "{$dialog}", $validation, false, $default, $list); + + return $helper->askAndValidate( + $this->output, "{$dialog}", $validation, false, $default, $list + ); + } + + /** + * @param $dialog + * @param null $default + * @return mixed + */ + protected function useSymfonyQuestion($dialog, $default = null, $validation) { + $question = new Question($dialog . ' ', $default); + $question->setValidator($validation); + $helper = $this->getHelper('question'); + + return $helper->ask($this->input, $this->output, $question); } } diff --git a/src/Laravel4Compatibility.php b/src/Laravel4Compatibility.php index 95fa44d..4d03e68 100644 --- a/src/Laravel4Compatibility.php +++ b/src/Laravel4Compatibility.php @@ -1,5 +1,8 @@ getHelperSet()->get('table'); + try { + $table = $this->getHelperSet()->get('table'); + } catch (InvalidArgumentException $error) { + // + } finally { + $table = new Table($this->output); + } + $table->setHeaders($headers); $table->setRows($rows); $table->render($this->output); diff --git a/src/Laravel50Compatibility.php b/src/Laravel50Compatibility.php index abe02b2..69de9ed 100644 --- a/src/Laravel50Compatibility.php +++ b/src/Laravel50Compatibility.php @@ -1,5 +1,8 @@ getHelperSet()->get('table'); + try { + $table = $this->getHelperSet()->get('table'); + } catch (InvalidArgumentException $error) { + // + } finally { + $table = new Table($this->output); + } + $table->setHeaders($headers); $table->setRows($rows); $table->render($this->output); diff --git a/src/Laravel51Compatibility.php b/src/Laravel51Compatibility.php index 551f34f..ae0cccc 100644 --- a/src/Laravel51Compatibility.php +++ b/src/Laravel51Compatibility.php @@ -1,5 +1,8 @@ getHelperSet()->get('table'); + try { + $table = $this->getHelperSet()->get('table'); + } catch (InvalidArgumentException $error) { + // + } finally { + $table = new Table($this->output); + } + $table->setHeaders($headers); $table->setRows($rows); $table->render($this->output); From 344b0ef00aa00f7c266d2866161cf6fa05c4b3e0 Mon Sep 17 00:00:00 2001 From: Piet de Vries Date: Tue, 22 Mar 2016 12:54:12 +0100 Subject: [PATCH 02/37] Support for files without extension in db:list Added support for files without extension in db:list. --- src/DbListCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DbListCommand.php b/src/DbListCommand.php index 9e207d8..9bbcbe9 100644 --- a/src/DbListCommand.php +++ b/src/DbListCommand.php @@ -76,7 +76,7 @@ public function fire() { if ($file['type'] == 'dir') continue; $rows[] = [ $file['basename'], - $file['extension'], + key_exists('extension', $file) ? $file['extension'] : null, $this->formatBytes($file['size']), date('D j Y H:i:s', $file['timestamp']) ]; From 4b079ec13a082d694fd92d9850af77bcf641ff32 Mon Sep 17 00:00:00 2001 From: Piet de Vries Date: Tue, 22 Mar 2016 13:08:40 +0100 Subject: [PATCH 03/37] Support for files without extension in db:restore --- src/DbRestoreCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DbRestoreCommand.php b/src/DbRestoreCommand.php index 8951c58..ead624e 100644 --- a/src/DbRestoreCommand.php +++ b/src/DbRestoreCommand.php @@ -176,7 +176,7 @@ private function askSourcePath() { if ($file['type'] == 'dir') continue; $rows[] = [ $file['basename'], - $file['extension'], + key_exists('extension', $file) ? $file['extension'] : null, $this->formatBytes($file['size']), date('D j Y H:i:s', $file['timestamp']) ]; From 8efb138051fe8d01f733d450e7e8fdda97740156 Mon Sep 17 00:00:00 2001 From: Shawn McCool Date: Tue, 15 Nov 2016 12:31:21 +0100 Subject: [PATCH 04/37] bump version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 51a54fc..0892431 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Laravel Driver for the Database Backup Manager +# Laravel Driver for the Database Backup Manager 1.1.1 This package pulls in the framework agnostic [Backup Manager](https://github.com/backup-manager/backup-manager) and provides seamless integration with **Laravel**. From a7f455358c8940c4059bb1edf62305337aef3833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B0=D0=BD=D1=8F?= Date: Thu, 5 Jan 2017 19:30:14 +0200 Subject: [PATCH 05/37] Make trait for absolutely identical code. Add key "ignoreTables" for databases with mysql driver. --- src/GetDatabaseConfig.php | 45 ++++++++++++++++++++++++++++++++ src/Laravel4ServiceProvider.php | 33 +---------------------- src/Laravel50ServiceProvider.php | 29 +------------------- src/Laravel5ServiceProvider.php | 29 +------------------- src/Lumen50ServiceProvider.php | 29 +------------------- src/LumenServiceProvider.php | 29 +------------------- 6 files changed, 50 insertions(+), 144 deletions(-) create mode 100644 src/GetDatabaseConfig.php diff --git a/src/GetDatabaseConfig.php b/src/GetDatabaseConfig.php new file mode 100644 index 0000000..42a33e8 --- /dev/null +++ b/src/GetDatabaseConfig.php @@ -0,0 +1,45 @@ + $connection['driver'], + 'host' => $connection['host'], + 'port' => $port, + 'user' => $connection['username'], + 'pass' => $connection['password'], + 'database' => $connection['database'], + 'ignoreTables' => $connection['driver'] === 'mysql' && isset($connection['ignoreTables']) + ? $connection['ignoreTables'] : null, + ]; + }, $connections); + return new Config($mapped); + } +} diff --git a/src/Laravel4ServiceProvider.php b/src/Laravel4ServiceProvider.php index a030cdf..1783170 100644 --- a/src/Laravel4ServiceProvider.php +++ b/src/Laravel4ServiceProvider.php @@ -13,6 +13,7 @@ * @package BackupManager\Laravel */ class Laravel4ServiceProvider extends ServiceProvider { + use GetDatabaseConfig; /** @var bool */ protected $defer = true; @@ -122,36 +123,4 @@ public function provides() { \BackupManager\ShellProcessing\ShellProcessor::class, ]; } - - /** - * @param $connections - * @return Config - */ - private function getDatabaseConfig($connections) { - $mapped = array_map(function ($connection) { - if ( ! in_array($connection['driver'], ['mysql', 'pgsql'])) { - return; - } - - if (isset($connection['port'])) { - $port = $connection['port']; - } else { - if ($connection['driver'] == 'mysql') { - $port = '3306'; - } elseif ($connection['driver'] == 'pgsql') { - $port = '5432'; - } - } - - return [ - 'type' => $connection['driver'], - 'host' => $connection['host'], - 'port' => $port, - 'user' => $connection['username'], - 'pass' => $connection['password'], - 'database' => $connection['database'], - ]; - }, $connections); - return new Config($mapped); - } } diff --git a/src/Laravel50ServiceProvider.php b/src/Laravel50ServiceProvider.php index 974f52e..fafc010 100644 --- a/src/Laravel50ServiceProvider.php +++ b/src/Laravel50ServiceProvider.php @@ -13,6 +13,7 @@ * @package BackupManager\Laravel */ class Laravel50ServiceProvider extends ServiceProvider { + use GetDatabaseConfig; protected $defer = true; @@ -123,32 +124,4 @@ public function provides() { \BackupManager\ShellProcessing\ShellProcessor::class, ]; } - - private function getDatabaseConfig($connections) { - $mapped = array_map(function ($connection) { - if ( ! in_array($connection['driver'], ['mysql', 'pgsql'])) { - return; - } - - if (isset($connection['port'])) { - $port = $connection['port']; - } else { - if ($connection['driver'] == 'mysql') { - $port = '3306'; - } elseif ($connection['driver'] == 'pgsql') { - $port = '5432'; - } - } - - return [ - 'type' => $connection['driver'], - 'host' => $connection['host'], - 'port' => $port, - 'user' => $connection['username'], - 'pass' => $connection['password'], - 'database' => $connection['database'], - ]; - }, $connections); - return new Config($mapped); - } } diff --git a/src/Laravel5ServiceProvider.php b/src/Laravel5ServiceProvider.php index 143da44..226e325 100644 --- a/src/Laravel5ServiceProvider.php +++ b/src/Laravel5ServiceProvider.php @@ -13,6 +13,7 @@ * @package BackupManager\Laravel */ class Laravel5ServiceProvider extends ServiceProvider { + use GetDatabaseConfig; protected $defer = true; @@ -124,32 +125,4 @@ public function provides() { \BackupManager\ShellProcessing\ShellProcessor::class, ]; } - - private function getDatabaseConfig($connections) { - $mapped = array_map(function ($connection) { - if ( ! in_array($connection['driver'], ['mysql', 'pgsql'])) { - return; - } - - if (isset($connection['port'])) { - $port = $connection['port']; - } else { - if ($connection['driver'] == 'mysql') { - $port = '3306'; - } elseif ($connection['driver'] == 'pgsql') { - $port = '5432'; - } - } - - return [ - 'type' => $connection['driver'], - 'host' => $connection['host'], - 'port' => $port, - 'user' => $connection['username'], - 'pass' => $connection['password'], - 'database' => $connection['database'], - ]; - }, $connections); - return new Config($mapped); - } } diff --git a/src/Lumen50ServiceProvider.php b/src/Lumen50ServiceProvider.php index a808e58..866bd62 100644 --- a/src/Lumen50ServiceProvider.php +++ b/src/Lumen50ServiceProvider.php @@ -13,6 +13,7 @@ * @package BackupManager\Laravel */ class Lumen50ServiceProvider extends ServiceProvider { + use GetDatabaseConfig; protected $defer = true; @@ -113,32 +114,4 @@ public function provides() { \BackupManager\ShellProcessing\ShellProcessor::class, ]; } - - private function getDatabaseConfig($connections) { - $mapped = array_map(function ($connection) { - if ( ! in_array($connection['driver'], ['mysql', 'pgsql'])) { - return; - } - - if (isset($connection['port'])) { - $port = $connection['port']; - } else { - if ($connection['driver'] == 'mysql') { - $port = '3306'; - } elseif ($connection['driver'] == 'pgsql') { - $port = '5432'; - } - } - - return [ - 'type' => $connection['driver'], - 'host' => $connection['host'], - 'port' => $port, - 'user' => $connection['username'], - 'pass' => $connection['password'], - 'database' => $connection['database'], - ]; - }, $connections); - return new Config($mapped); - } } diff --git a/src/LumenServiceProvider.php b/src/LumenServiceProvider.php index 64cec63..1d27a40 100644 --- a/src/LumenServiceProvider.php +++ b/src/LumenServiceProvider.php @@ -13,6 +13,7 @@ * @package BackupManager\Laravel */ class LumenServiceProvider extends ServiceProvider { + use GetDatabaseConfig; protected $defer = true; @@ -114,32 +115,4 @@ public function provides() { \BackupManager\ShellProcessing\ShellProcessor::class, ]; } - - private function getDatabaseConfig($connections) { - $mapped = array_map(function ($connection) { - if ( ! in_array($connection['driver'], ['mysql', 'pgsql'])) { - return; - } - - if (isset($connection['port'])) { - $port = $connection['port']; - } else { - if ($connection['driver'] == 'mysql') { - $port = '3306'; - } elseif ($connection['driver'] == 'pgsql') { - $port = '5432'; - } - } - - return [ - 'type' => $connection['driver'], - 'host' => $connection['host'], - 'port' => $port, - 'user' => $connection['username'], - 'pass' => $connection['password'], - 'database' => $connection['database'], - ]; - }, $connections); - return new Config($mapped); - } } From ef968a54d5f3b98063f54210d835fa5350a81450 Mon Sep 17 00:00:00 2001 From: soulofmachines Date: Mon, 27 Mar 2017 20:43:44 +0300 Subject: [PATCH 06/37] return inside finally block --- src/AutoComplete.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/AutoComplete.php b/src/AutoComplete.php index bde69f1..d215530 100644 --- a/src/AutoComplete.php +++ b/src/AutoComplete.php @@ -30,9 +30,8 @@ public function autocomplete($dialog, array $list, $default = null) { return $this->useSymfontDialog($dialog, $list, $default, $validation); } catch (InvalidArgumentException $error) { // - } finally { - return $this->useSymfonyQuestion($dialog, $default, $validation); } + return $this->useSymfonyQuestion($dialog, $default, $validation); } /** From fc5d3144cceef9bc27cd0f515b3853fd912eaa88 Mon Sep 17 00:00:00 2001 From: Raza Mehdi Date: Fri, 30 Jun 2017 23:24:54 +0500 Subject: [PATCH 07/37] Update package --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 51a54fc..5530806 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Then, you'll need to select the appropriate packages for the adapters that you w composer require league/flysystem-aws-s3-v3 # to support dropbox -composer require league/flysystem-dropbox +composer require srmklive/flysystem-dropbox-v2 # to support rackspace composer require league/flysystem-rackspace From d922972af50eb58eadb535c7eed74dbb5b22e1b9 Mon Sep 17 00:00:00 2001 From: Laurence Ioannou Date: Mon, 31 Jul 2017 00:31:32 +0100 Subject: [PATCH 08/37] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5530806..370d4c7 100644 --- a/README.md +++ b/README.md @@ -147,7 +147,7 @@ It's possible to schedule backups using Laravel's scheduler. */ protected function schedule(Schedule $schedule) { $date = Carbon::now()->toW3cString(); - $environment = env('APP_ENV'); + $environment = config('app.env'); $schedule->command( "db:backup --database=mysql --destination=s3 --destinationPath=/{$environment}/projectname_{$environment}_{$date} --compression=gzip" )->twiceDaily(13,21); From acbb42ae95639c9bd5cf7c2106d6e9594484bdf6 Mon Sep 17 00:00:00 2001 From: Laurence Date: Mon, 31 Jul 2017 10:15:58 +0000 Subject: [PATCH 09/37] add timestamp option --- README.md | 23 +++++++++++------------ src/DbBackupCommand.php | 17 +++++++++++++---- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 370d4c7..d6621d7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Laravel Driver for the Database Backup Manager -This package pulls in the framework agnostic [Backup Manager](https://github.com/backup-manager/backup-manager) and provides seamless integration with **Laravel**. +This package pulls in the framework agnostic [Backup Manager](https://github.com/backup-manager/backup-manager) and provides seamless integration with **Laravel**. [Watch a video tour](https://www.youtube.com/watch?v=vWXy0R8OavM) to get an idea what is possible with this package. @@ -80,7 +80,7 @@ BackupManager\Laravel\Laravel5ServiceProvider::class, Publish the storage configuration file. -```php +```php php artisan vendor:publish --provider="BackupManager\Laravel\Laravel5ServiceProvider" ``` @@ -129,10 +129,10 @@ All will prompt you with simple questions to successfully execute the command. **Example Command for 24hour scheduled cronjob** ``` -php artisan db:backup --database=mysql --destination=dropbox --destinationPath=`date +\%Y/%d-%m-%Y` --compression=gzip +php artisan db:backup --database=mysql --destination=dropbox --destinationPath=project --timestamp="d-m-Y" --compression=gzip ``` -This command will backup your database to dropbox using mysql and gzip compresion in path /backups/YEAR/DATE.gz (ex: /backups/2015/29-10-2015.gz) +This command will backup your database to dropbox using mysql and gzip compresion in path /backups/project/DATE.gz (ex: /backups/project/31-7-2015.gz) ### Scheduling Backups @@ -145,15 +145,14 @@ It's possible to schedule backups using Laravel's scheduler. * @param \Illuminate\Console\Scheduling\Schedule $schedule * @return void */ -protected function schedule(Schedule $schedule) { - $date = Carbon::now()->toW3cString(); - $environment = config('app.env'); - $schedule->command( - "db:backup --database=mysql --destination=s3 --destinationPath=/{$environment}/projectname_{$environment}_{$date} --compression=gzip" - )->twiceDaily(13,21); -} + protected function schedule(Schedule $schedule) { + $environment = config('app.env'); + $schedule->command( + "db:backup --database=mysql --destination=s3 --destinationPath=/{$environment}/projectname --timestamp="Y_m_d_H_i_s" --compression=gzip" + )->twiceDaily(13,21); + } ``` - + ### Contribution Guidelines We recommend using the vagrant configuration supplied with this package for development and contribution. Simply install VirtualBox, Vagrant, and Ansible then run `vagrant up` in the root folder. A virtualmachine specifically designed for development of the package will be built and launched for you. diff --git a/src/DbBackupCommand.php b/src/DbBackupCommand.php index e044d15..ef7e1e8 100644 --- a/src/DbBackupCommand.php +++ b/src/DbBackupCommand.php @@ -35,6 +35,13 @@ class DbBackupCommand extends Command { */ private $required = ['database', 'destination', 'destinationPath', 'compression']; + /** + * Optional timestamp. + * + * @var string + */ + private $timestamp; + /** * The missing arguments. * @@ -80,6 +87,8 @@ public function __construct(BackupProcedure $backupProcedure, DatabaseProvider $ * @return mixed */ public function fire() { + $this->timestamp = date($this->option('timestamp')); + if ($this->isMissingArguments()) { $this->displayMissingArguments(); $this->promptForMissingArgumentValues(); @@ -89,11 +98,10 @@ public function fire() { $destinations = [ new Destination( $this->option('destination'), - $this->option('destinationPath') + $this->option('destinationPath') . $this->timestamp ) ]; - $this->info('Dumping database and uploading...'); $this->backupProcedure->run( $this->option('database'), $destinations, @@ -106,7 +114,7 @@ public function fire() { $this->option('database'), $this->option('compression'), $this->option('destination'), - $root .DIRECTORY_SEPARATOR. $this->option('destinationPath') + $destinations[0]->destinationPath() )); } @@ -191,7 +199,7 @@ private function validateArguments() { $this->info(sprintf('Do you want to create a backup of %s, store it on %s at %s and compress it to %s?', $this->option('database'), $this->option('destination'), - $root . $this->option('destinationPath'), + $root . $this->option('destinationPath') . $this->timestamp, $this->option('compression') )); $this->line(''); @@ -224,6 +232,7 @@ protected function getOptions() { ['destination', null, InputOption::VALUE_OPTIONAL, 'Destination configuration name', null], ['destinationPath', null, InputOption::VALUE_OPTIONAL, 'File destination path', null], ['compression', null, InputOption::VALUE_OPTIONAL, 'Compression type', null], + ['timestamp', null, InputOption::VALUE_OPTIONAL, 'Append timestamp to filename', null], ]; } } From dce9280fc6a2e98e58f933e1c40451e2dd1c0866 Mon Sep 17 00:00:00 2001 From: Laurence Date: Mon, 31 Jul 2017 10:19:22 +0000 Subject: [PATCH 10/37] include info line --- src/DbBackupCommand.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/DbBackupCommand.php b/src/DbBackupCommand.php index ef7e1e8..e89ca28 100644 --- a/src/DbBackupCommand.php +++ b/src/DbBackupCommand.php @@ -102,6 +102,7 @@ public function fire() { ) ]; + $this->info('Dumping database and uploading...'); $this->backupProcedure->run( $this->option('database'), $destinations, From 343885742036ff6a20850190c9bfcfa697087a94 Mon Sep 17 00:00:00 2001 From: Shawn McCool Date: Mon, 31 Jul 2017 14:23:01 +0200 Subject: [PATCH 11/37] add 1.2.0 documentation header --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9b2d669..18626bb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Laravel Driver for the Database Backup Manager 1.1.1 +# Laravel Driver for the Database Backup Manager 1.2.0 This package pulls in the framework agnostic [Backup Manager](https://github.com/backup-manager/backup-manager) and provides seamless integration with **Laravel**. From aff0ed69baf659540497713376c0b5d9fd6e269e Mon Sep 17 00:00:00 2001 From: armandsar Date: Wed, 30 Aug 2017 19:50:31 +0300 Subject: [PATCH 12/37] add laravel 5.5 compatibility --- README.md | 5 +- src/Laravel55Compatibility.php | 35 ++++++++ src/Laravel55DbBackupCommand.php | 11 +++ src/Laravel55DbListCommand.php | 11 +++ src/Laravel55DbRestoreCommand.php | 11 +++ src/Laravel55ServiceProvider.php | 128 ++++++++++++++++++++++++++++++ 6 files changed, 200 insertions(+), 1 deletion(-) create mode 100644 src/Laravel55Compatibility.php create mode 100644 src/Laravel55DbBackupCommand.php create mode 100644 src/Laravel55DbListCommand.php create mode 100644 src/Laravel55DbRestoreCommand.php create mode 100644 src/Laravel55ServiceProvider.php diff --git a/README.md b/README.md index 18626bb..01b8181 100644 --- a/README.md +++ b/README.md @@ -74,8 +74,11 @@ To install into a Laravel project, first do the composer install then add *ONE * // FOR LARAVEL 5.0 ONLY BackupManager\Laravel\Laravel50ServiceProvider::class, -// FOR LARAVEL 5.1 AND ABOVE +// FOR LARAVEL 5.1 - 5.4 BackupManager\Laravel\Laravel5ServiceProvider::class, + +// FOR LARAVEL 5.5 +BackupManager\Laravel\Laravel55ServiceProvider::class, ``` Publish the storage configuration file. diff --git a/src/Laravel55Compatibility.php b/src/Laravel55Compatibility.php new file mode 100644 index 0000000..c308861 --- /dev/null +++ b/src/Laravel55Compatibility.php @@ -0,0 +1,35 @@ +getHelperSet()->get('table'); + } catch (InvalidArgumentException $error) { + // + } finally { + $table = new Table($this->output); + } + + $table->setHeaders($headers); + $table->setRows($rows); + $table->render($this->output); + } + + public function handle() + { + $this->fire(); + } +} diff --git a/src/Laravel55DbBackupCommand.php b/src/Laravel55DbBackupCommand.php new file mode 100644 index 0000000..fba0c69 --- /dev/null +++ b/src/Laravel55DbBackupCommand.php @@ -0,0 +1,11 @@ +publishes([$configPath => config_path('backup-manager.php')], 'config'); + } + + /** + * Register the service provider. + * + * @return void + */ + public function register() { + $configPath = __DIR__ . '/../config/backup-manager.php'; + $this->mergeConfigFrom($configPath, 'backup-manager'); + $this->registerFilesystemProvider(); + $this->registerDatabaseProvider(); + $this->registerCompressorProvider(); + $this->registerShellProcessor(); + $this->registerArtisanCommands(); + } + + /** + * Register the filesystem provider. + * + * @return void + */ + private function registerFilesystemProvider() { + $this->app->bind(\BackupManager\Filesystems\FilesystemProvider::class, function ($app) { + $provider = new Filesystems\FilesystemProvider(new Config($app['config']['backup-manager'])); + $provider->add(new Filesystems\Awss3Filesystem); + $provider->add(new Filesystems\GcsFilesystem); + $provider->add(new Filesystems\DropboxFilesystem); + $provider->add(new Filesystems\FtpFilesystem); + $provider->add(new Filesystems\LocalFilesystem); + $provider->add(new Filesystems\RackspaceFilesystem); + $provider->add(new Filesystems\SftpFilesystem); + return $provider; + }); + } + + /** + * Register the database provider. + * + * @return void + */ + private function registerDatabaseProvider() { + $this->app->bind(\BackupManager\Databases\DatabaseProvider::class, function ($app) { + $provider = new Databases\DatabaseProvider($this->getDatabaseConfig($app['config']['database.connections'])); + $provider->add(new Databases\MysqlDatabase); + $provider->add(new Databases\PostgresqlDatabase); + return $provider; + }); + } + + /** + * Register the compressor provider. + * + * @return void + */ + private function registerCompressorProvider() { + $this->app->bind(\BackupManager\Compressors\CompressorProvider::class, function () { + $provider = new Compressors\CompressorProvider; + $provider->add(new Compressors\GzipCompressor); + $provider->add(new Compressors\NullCompressor); + return $provider; + }); + } + + /** + * Register the filesystem provider. + * + * @return void + */ + private function registerShellProcessor() { + $this->app->bind(\BackupManager\ShellProcessing\ShellProcessor::class, function () { + return new ShellProcessor(new Process('', null, null, null, null)); + }); + } + + /** + * Register the artisan commands. + * + * @return void + */ + private function registerArtisanCommands() { + $this->commands([ + \BackupManager\Laravel\Laravel55DbBackupCommand::class, + \BackupManager\Laravel\Laravel55DbRestoreCommand::class, + \BackupManager\Laravel\Laravel55DbListCommand::class, + ]); + } + + /** + * Get the services provided by the provider. + * + * @return array + */ + public function provides() { + return [ + \BackupManager\Filesystems\FilesystemProvider::class, + \BackupManager\Databases\DatabaseProvider::class, + \BackupManager\ShellProcessing\ShellProcessor::class, + ]; + } +} From b415a594bf3eb8d7c6acc35f03a44b817dd692db Mon Sep 17 00:00:00 2001 From: Shawn McCool Date: Fri, 8 Sep 2017 14:13:35 +0200 Subject: [PATCH 13/37] bump to 1.2.1 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 01b8181..9835301 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Laravel Driver for the Database Backup Manager 1.2.0 +# Laravel Driver for the Database Backup Manager 1.2.1 This package pulls in the framework agnostic [Backup Manager](https://github.com/backup-manager/backup-manager) and provides seamless integration with **Laravel**. From 3f48ebdbcdf06a9b7c57b0f864fca26570f54a6b Mon Sep 17 00:00:00 2001 From: PXgamer Date: Mon, 18 Sep 2017 11:40:24 +0100 Subject: [PATCH 14/37] Added Laravel 5.5 auto-discovery meta to the composer.json --- composer.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/composer.json b/composer.json index a3eca06..a3a92e8 100644 --- a/composer.json +++ b/composer.json @@ -36,6 +36,11 @@ "extra": { "branch-alias": { "dev-master": "1.0-dev" + }, + "laravel": { + "providers": [ + "BackupManager\\Laravel\\Laravel55ServiceProvider" + ] } }, "license": "MIT" From 17a8d6325332114d2317b200deb7fe5a5337ac7b Mon Sep 17 00:00:00 2001 From: James Date: Wed, 20 Sep 2017 10:06:20 -0700 Subject: [PATCH 15/37] Fixes ErrorException in Laravel 5.5 [ErrorException] Declaration of BackupManager\Laravel\Laravel55Compatibility::table($headers, $rows, $style = 'default') should be compati ble with Illuminate\Console\Command::table($headers, $rows, $tableStyle = 'default', array $columnStyles = Array) --- src/Laravel55Compatibility.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Laravel55Compatibility.php b/src/Laravel55Compatibility.php index c308861..6ebc2e3 100644 --- a/src/Laravel55Compatibility.php +++ b/src/Laravel55Compatibility.php @@ -9,12 +9,13 @@ */ trait Laravel55Compatibility { /** - * @param array $headers - * @param array $rows - * @internal param string $style + * @param $headers + * @param $rows + * @param string $style + * @param array $columnStyles * @return void */ - public function table($headers, $rows, $style = 'default') { + public function table($headers, $rows, $style = 'default', array $columnStyles = []) { try { $table = $this->getHelperSet()->get('table'); } catch (InvalidArgumentException $error) { From 091374d1da68af269b19c302553e9cea560b5645 Mon Sep 17 00:00:00 2001 From: Shawn McCool Date: Thu, 28 Sep 2017 07:28:29 +0200 Subject: [PATCH 16/37] bump to 1.2.2 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9835301..e0a6a49 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Laravel Driver for the Database Backup Manager 1.2.1 +# Laravel Driver for the Database Backup Manager 1.2.2 This package pulls in the framework agnostic [Backup Manager](https://github.com/backup-manager/backup-manager) and provides seamless integration with **Laravel**. From 0d2a574817f8cc395ee0dbd7ca60375e61b2f679 Mon Sep 17 00:00:00 2001 From: Armands Leinieks Date: Wed, 7 Feb 2018 21:03:33 +0200 Subject: [PATCH 17/37] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a3a92e8..6f50266 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "require": { "backup-manager/backup-manager": "^1.0", "php": ">=5.5.0", - "symfony/process": "^2.0||^3.0", + "symfony/process": "^2.0||^3.0||^4.0", "illuminate/support": "^4.0||^5.0", "illuminate/container": "^4.0||^5.0", "illuminate/console": "^4.0||^5.0" From 12aed7fa11161a4707164c36b0f5f5be0802f4da Mon Sep 17 00:00:00 2001 From: Tint Naing Win Date: Mon, 12 Feb 2018 10:53:36 +0630 Subject: [PATCH 18/37] Added DropboxV2Filesystem --- config/backup-manager.php | 2 +- src/Laravel4ServiceProvider.php | 1 + src/Laravel50ServiceProvider.php | 1 + src/Laravel55ServiceProvider.php | 1 + src/Laravel5ServiceProvider.php | 1 + src/Lumen50ServiceProvider.php | 1 + src/LumenServiceProvider.php | 1 + 7 files changed, 7 insertions(+), 1 deletion(-) diff --git a/config/backup-manager.php b/config/backup-manager.php index f2dd3dc..25fff2f 100644 --- a/config/backup-manager.php +++ b/config/backup-manager.php @@ -30,7 +30,7 @@ 'root' => '', ], 'dropbox' => [ - 'type' => 'Dropbox', + 'type' => 'DropboxV2', 'token' => '', 'key' => '', 'secret' => '', diff --git a/src/Laravel4ServiceProvider.php b/src/Laravel4ServiceProvider.php index 1783170..706ed09 100644 --- a/src/Laravel4ServiceProvider.php +++ b/src/Laravel4ServiceProvider.php @@ -51,6 +51,7 @@ private function registerFilesystemProvider() { $provider->add(new Filesystems\Awss3Filesystem); $provider->add(new Filesystems\GcsFilesystem); $provider->add(new Filesystems\DropboxFilesystem); + $provider->add(new Filesystems\DropboxV2Filesystem); $provider->add(new Filesystems\FtpFilesystem); $provider->add(new Filesystems\LocalFilesystem); $provider->add(new Filesystems\RackspaceFilesystem); diff --git a/src/Laravel50ServiceProvider.php b/src/Laravel50ServiceProvider.php index fafc010..3fb61f3 100644 --- a/src/Laravel50ServiceProvider.php +++ b/src/Laravel50ServiceProvider.php @@ -52,6 +52,7 @@ private function registerFilesystemProvider() { $provider = new Filesystems\FilesystemProvider(new Config($app['config']['backup-manager'])); $provider->add(new Filesystems\Awss3Filesystem); $provider->add(new Filesystems\DropboxFilesystem); + $provider->add(new Filesystems\DropboxV2Filesystem); $provider->add(new Filesystems\FtpFilesystem); $provider->add(new Filesystems\LocalFilesystem); $provider->add(new Filesystems\RackspaceFilesystem); diff --git a/src/Laravel55ServiceProvider.php b/src/Laravel55ServiceProvider.php index eb9586f..f0e7bd8 100644 --- a/src/Laravel55ServiceProvider.php +++ b/src/Laravel55ServiceProvider.php @@ -53,6 +53,7 @@ private function registerFilesystemProvider() { $provider->add(new Filesystems\Awss3Filesystem); $provider->add(new Filesystems\GcsFilesystem); $provider->add(new Filesystems\DropboxFilesystem); + $provider->add(new Filesystems\DropboxV2Filesystem); $provider->add(new Filesystems\FtpFilesystem); $provider->add(new Filesystems\LocalFilesystem); $provider->add(new Filesystems\RackspaceFilesystem); diff --git a/src/Laravel5ServiceProvider.php b/src/Laravel5ServiceProvider.php index 226e325..e54afb5 100644 --- a/src/Laravel5ServiceProvider.php +++ b/src/Laravel5ServiceProvider.php @@ -53,6 +53,7 @@ private function registerFilesystemProvider() { $provider->add(new Filesystems\Awss3Filesystem); $provider->add(new Filesystems\GcsFilesystem); $provider->add(new Filesystems\DropboxFilesystem); + $provider->add(new Filesystems\DropboxV2Filesystem); $provider->add(new Filesystems\FtpFilesystem); $provider->add(new Filesystems\LocalFilesystem); $provider->add(new Filesystems\RackspaceFilesystem); diff --git a/src/Lumen50ServiceProvider.php b/src/Lumen50ServiceProvider.php index 866bd62..6c878ca 100644 --- a/src/Lumen50ServiceProvider.php +++ b/src/Lumen50ServiceProvider.php @@ -42,6 +42,7 @@ private function registerFilesystemProvider() { $provider = new Filesystems\FilesystemProvider(new Config($app['config']['backup-manager'])); $provider->add(new Filesystems\Awss3Filesystem); $provider->add(new Filesystems\DropboxFilesystem); + $provider->add(new Filesystems\DropboxV2Filesystem); $provider->add(new Filesystems\FtpFilesystem); $provider->add(new Filesystems\LocalFilesystem); $provider->add(new Filesystems\RackspaceFilesystem); diff --git a/src/LumenServiceProvider.php b/src/LumenServiceProvider.php index 1d27a40..b971f74 100644 --- a/src/LumenServiceProvider.php +++ b/src/LumenServiceProvider.php @@ -43,6 +43,7 @@ private function registerFilesystemProvider() { $provider->add(new Filesystems\Awss3Filesystem); $provider->add(new Filesystems\GcsFilesystem); $provider->add(new Filesystems\DropboxFilesystem); + $provider->add(new Filesystems\DropboxV2Filesystem); $provider->add(new Filesystems\FtpFilesystem); $provider->add(new Filesystems\LocalFilesystem); $provider->add(new Filesystems\RackspaceFilesystem); From 6a69ee593cf4d05acde49c76f1b2effa1c2be29d Mon Sep 17 00:00:00 2001 From: Shawn McCool Date: Mon, 12 Feb 2018 13:59:36 +0100 Subject: [PATCH 19/37] upgrade to laravel 5.6 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e0a6a49..24c5837 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Laravel Driver for the Database Backup Manager 1.2.2 +# Laravel Driver for the Database Backup Manager 1.3.0 This package pulls in the framework agnostic [Backup Manager](https://github.com/backup-manager/backup-manager) and provides seamless integration with **Laravel**. From 672e4a8c2c530af1e014e4f826214c59f0ae4bba Mon Sep 17 00:00:00 2001 From: madworks Date: Wed, 11 Apr 2018 23:13:00 +0900 Subject: [PATCH 20/37] Initialized s3 config by environment variables. --- config/backup-manager.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/backup-manager.php b/config/backup-manager.php index 25fff2f..3811221 100644 --- a/config/backup-manager.php +++ b/config/backup-manager.php @@ -7,10 +7,10 @@ ], 's3' => [ 'type' => 'AwsS3', - 'key' => '', - 'secret' => '', - 'region' => 'us-east-1', - 'bucket' => '', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION'), + 'bucket' => env('AWS_BUCKET'), 'root' => '', ], 'gcs' => [ From 4c2875ee73ebeaf464cf47e88ed0dd57040f1306 Mon Sep 17 00:00:00 2001 From: Panayiotis Date: Thu, 7 Jun 2018 17:31:51 +0300 Subject: [PATCH 21/37] Lumen 5.5 Service Provider --- README.md | 6 +- src/Lumen55ServiceProvider.php | 118 +++++++++++++++++++++++++++++++++ 2 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 src/Lumen55ServiceProvider.php diff --git a/README.md b/README.md index 24c5837..bf08e89 100644 --- a/README.md +++ b/README.md @@ -98,9 +98,13 @@ To install into a Lumen project, first do the composer install then add the conf $app->configure('backup-manager'); $app->register(BackupManager\Laravel\Lumen50ServiceProvider::class); -// FOR LUMEN 5.1 AND ABOVE +// FOR LUMEN 5.1 - 5.4 $app->configure('backup-manager'); $app->register(BackupManager\Laravel\LumenServiceProvider::class); + +// FOR LUMEN 5.5 AND ABOVE +$app->configure('backup-manager'); +$app->register(BackupManager\Laravel\Lumen55ServiceProvider::class); ``` Copy the `vendor/backup-manager/laravel/config/backup-manager.php` file to `config/backup-manager.php` and configure it to suit your needs. diff --git a/src/Lumen55ServiceProvider.php b/src/Lumen55ServiceProvider.php new file mode 100644 index 0000000..3f88700 --- /dev/null +++ b/src/Lumen55ServiceProvider.php @@ -0,0 +1,118 @@ +mergeConfigFrom($configPath, 'backup-manager'); + $this->registerFilesystemProvider(); + $this->registerDatabaseProvider(); + $this->registerCompressorProvider(); + $this->registerShellProcessor(); + $this->registerArtisanCommands(); + } + + /** + * Register the filesystem provider. + * + * @return void + */ + private function registerFilesystemProvider() { + $this->app->bind(\BackupManager\Filesystems\FilesystemProvider::class, function ($app) { + $provider = new Filesystems\FilesystemProvider(new Config($app['config']['backup-manager'])); + $provider->add(new Filesystems\Awss3Filesystem); + $provider->add(new Filesystems\DropboxFilesystem); + $provider->add(new Filesystems\DropboxV2Filesystem); + $provider->add(new Filesystems\FtpFilesystem); + $provider->add(new Filesystems\LocalFilesystem); + $provider->add(new Filesystems\RackspaceFilesystem); + $provider->add(new Filesystems\SftpFilesystem); + return $provider; + }); + } + + /** + * Register the database provider. + * + * @return void + */ + private function registerDatabaseProvider() { + $this->app->bind(\BackupManager\Databases\DatabaseProvider::class, function ($app) { + $provider = new Databases\DatabaseProvider($this->getDatabaseConfig($app['config']['database.connections'])); + $provider->add(new Databases\MysqlDatabase); + $provider->add(new Databases\PostgresqlDatabase); + return $provider; + }); + } + + /** + * Register the compressor provider. + * + * @return void + */ + private function registerCompressorProvider() { + $this->app->bind(\BackupManager\Compressors\CompressorProvider::class, function () { + $provider = new Compressors\CompressorProvider; + $provider->add(new Compressors\GzipCompressor); + $provider->add(new Compressors\NullCompressor); + return $provider; + }); + } + + /** + * Register the filesystem provider. + * + * @return void + */ + private function registerShellProcessor() { + $this->app->bind(\BackupManager\ShellProcessing\ShellProcessor::class, function () { + return new ShellProcessor(new Process('')); + }); + } + + /** + * Register the artisan commands. + * + * @return void + */ + private function registerArtisanCommands() { + $this->commands([ + \BackupManager\Laravel\Laravel55DbBackupCommand::class, + \BackupManager\Laravel\Laravel55DbRestoreCommand::class, + \BackupManager\Laravel\Laravel55DbListCommand::class, + ]); + } + + /** + * Get the services provided by the provider. + * + * @return array + */ + public function provides() { + return [ + \BackupManager\Filesystems\FilesystemProvider::class, + \BackupManager\Databases\DatabaseProvider::class, + \BackupManager\ShellProcessing\ShellProcessor::class, + ]; + } +} From 369782a7814f58e740b2d3b35c719facb287af3e Mon Sep 17 00:00:00 2001 From: Shawn McCool Date: Mon, 18 Jun 2018 11:20:25 +0200 Subject: [PATCH 22/37] update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bf08e89..f7874f6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Laravel Driver for the Database Backup Manager 1.3.0 +# Laravel Driver for the Database Backup Manager 1.3.1 This package pulls in the framework agnostic [Backup Manager](https://github.com/backup-manager/backup-manager) and provides seamless integration with **Laravel**. From 78a52e15dd0e57c8562d3c5d6cfaad16bab73477 Mon Sep 17 00:00:00 2001 From: Robbie <13571547+robbielove@users.noreply.github.com> Date: Sun, 30 Dec 2018 14:22:07 +1000 Subject: [PATCH 23/37] Update GetDatabaseConfig.php add compatibility for mysql 8.0 where column-statistics is not present anymore and will cause backups to fail, this change is needed because backup manager allows extra params and it is possible to set `--column-statistics=0`, however backup-manager/laravel just passes the config from backup-manager - providing no opportunity for these extra params to be included --- src/GetDatabaseConfig.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/GetDatabaseConfig.php b/src/GetDatabaseConfig.php index 42a33e8..6320b88 100644 --- a/src/GetDatabaseConfig.php +++ b/src/GetDatabaseConfig.php @@ -38,6 +38,8 @@ private function getDatabaseConfig($connections) { 'database' => $connection['database'], 'ignoreTables' => $connection['driver'] === 'mysql' && isset($connection['ignoreTables']) ? $connection['ignoreTables'] : null, + // add additional options to dump-command (like '--max-allowed-packet') + 'extraParams' => '--column-statistics=0', ]; }, $connections); return new Config($mapped); From cd7f7684144013ad2b1e9e27a549a45a36ad9ec1 Mon Sep 17 00:00:00 2001 From: David Carr Date: Tue, 3 Sep 2019 21:23:25 +0100 Subject: [PATCH 24/37] Update composer.json --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 6f50266..6882e99 100644 --- a/composer.json +++ b/composer.json @@ -17,9 +17,9 @@ "backup-manager/backup-manager": "^1.0", "php": ">=5.5.0", "symfony/process": "^2.0||^3.0||^4.0", - "illuminate/support": "^4.0||^5.0", - "illuminate/container": "^4.0||^5.0", - "illuminate/console": "^4.0||^5.0" + "illuminate/support": "^4.0||^5.0||^6.0", + "illuminate/container": "^4.0||^5.0||^6.0", + "illuminate/console": "^4.0||^5.0||^6.0" }, "require-dev": { "mockery/mockery": "dev-master", From 2b696bd5e8c2afe8313ce56d68c446c99dc76aba Mon Sep 17 00:00:00 2001 From: Nafies Luthfi Date: Sat, 5 Oct 2019 08:40:44 +0800 Subject: [PATCH 25/37] fix: Remove -column-statistics=0 extra params --- src/GetDatabaseConfig.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GetDatabaseConfig.php b/src/GetDatabaseConfig.php index 6320b88..fe1fbfd 100644 --- a/src/GetDatabaseConfig.php +++ b/src/GetDatabaseConfig.php @@ -39,7 +39,7 @@ private function getDatabaseConfig($connections) { 'ignoreTables' => $connection['driver'] === 'mysql' && isset($connection['ignoreTables']) ? $connection['ignoreTables'] : null, // add additional options to dump-command (like '--max-allowed-packet') - 'extraParams' => '--column-statistics=0', + 'extraParams' => '', ]; }, $connections); return new Config($mapped); From 5bafa111c0602936ebf2d1de5ddd8a458a221b3e Mon Sep 17 00:00:00 2001 From: Nafies Luthfi Date: Sat, 5 Oct 2019 09:42:05 +0800 Subject: [PATCH 26/37] feat: Move extra params to config file --- config/backup-manager.php | 3 +++ src/GetDatabaseConfig.php | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/backup-manager.php b/config/backup-manager.php index 3811221..4787e5d 100644 --- a/config/backup-manager.php +++ b/config/backup-manager.php @@ -58,4 +58,7 @@ 'privateKey' => '', 'root' => '', ], + + // Add additional options to dump-command (like '--max-allowed-packet') + 'command-extra-params' => '', ]; diff --git a/src/GetDatabaseConfig.php b/src/GetDatabaseConfig.php index fe1fbfd..dd0eb77 100644 --- a/src/GetDatabaseConfig.php +++ b/src/GetDatabaseConfig.php @@ -38,8 +38,7 @@ private function getDatabaseConfig($connections) { 'database' => $connection['database'], 'ignoreTables' => $connection['driver'] === 'mysql' && isset($connection['ignoreTables']) ? $connection['ignoreTables'] : null, - // add additional options to dump-command (like '--max-allowed-packet') - 'extraParams' => '', + 'extraParams' => config('backup-manager.command-extra-params'), ]; }, $connections); return new Config($mapped); From 031ad1ec3eaa194e1acd5bf49cd63c2043e98c90 Mon Sep 17 00:00:00 2001 From: Nafies Luthfi Date: Sat, 5 Oct 2019 21:08:47 +0800 Subject: [PATCH 27/37] feat: Set extra params in env variable --- README.md | 6 ++++++ config/backup-manager.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f7874f6..328b207 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,12 @@ php artisan vendor:publish --provider="BackupManager\Laravel\Laravel5ServiceProv The Backup Manager will make use of Laravel's database configuration. But, it won't know about any connections that might be tied to other environments, so it can be best to just list multiple connections in the `config/database.php` file. +We can also add extra parameters on our backup manager commands by configuring extra params on `.env` file: + +``` +BACKUP_MANAGER_EXTRA_PARAMS="--column-statistics=0 --max-allowed-packet" +``` + #### Lumen Configuration To install into a Lumen project, first do the composer install then add the configuration file loader and *ONE* of the following service providers to your `bootstrap/app.php`. diff --git a/config/backup-manager.php b/config/backup-manager.php index 4787e5d..c06df12 100644 --- a/config/backup-manager.php +++ b/config/backup-manager.php @@ -60,5 +60,5 @@ ], // Add additional options to dump-command (like '--max-allowed-packet') - 'command-extra-params' => '', + 'command-extra-params' => env('BACKUP_MANAGER_EXTRA_PARAMS'), ]; From dc114f1191a7d8a84fc52bebb1163c264d0b3da5 Mon Sep 17 00:00:00 2001 From: Shawn McCool Date: Tue, 8 Oct 2019 13:51:01 +0200 Subject: [PATCH 28/37] remove version from readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 328b207..035799c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Laravel Driver for the Database Backup Manager 1.3.1 +# Laravel Driver for the Database Backup Manager This package pulls in the framework agnostic [Backup Manager](https://github.com/backup-manager/backup-manager) and provides seamless integration with **Laravel**. From 7d3e7d452cfee8b9800187eb3ffe769682ae1749 Mon Sep 17 00:00:00 2001 From: madworks Date: Sun, 2 Feb 2020 17:41:05 +0900 Subject: [PATCH 29/37] Updated config of "gcs" --- config/backup-manager.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/config/backup-manager.php b/config/backup-manager.php index c06df12..5e9e5c2 100644 --- a/config/backup-manager.php +++ b/config/backup-manager.php @@ -15,10 +15,11 @@ ], 'gcs' => [ 'type' => 'Gcs', - 'key' => '', - 'secret' => '', + 'project' => '', + 'keyFilePath' => '', 'bucket' => '', - 'root' => '', + 'root' => '', + 'prefix' => '', ], 'rackspace' => [ 'type' => 'Rackspace', From aecf0f752103d609c2d03f4f15f156a83d7b0408 Mon Sep 17 00:00:00 2001 From: madworks Date: Sun, 2 Feb 2020 17:56:21 +0900 Subject: [PATCH 30/37] Updated README.md for gcs --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 035799c..06ba0c2 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,9 @@ composer require league/flysystem-rackspace # to support sftp composer require league/flysystem-sftp + +# to support gcs +composer require superbalist/flysystem-google-storage ``` #### Laravel 4 Configuration From ea253cd7f1f97f952c4353018a70162b6277d95e Mon Sep 17 00:00:00 2001 From: madworks Date: Sun, 2 Feb 2020 18:00:21 +0900 Subject: [PATCH 31/37] Initialized gcs config by environment variables. --- config/backup-manager.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/backup-manager.php b/config/backup-manager.php index 5e9e5c2..f17036b 100644 --- a/config/backup-manager.php +++ b/config/backup-manager.php @@ -15,11 +15,11 @@ ], 'gcs' => [ 'type' => 'Gcs', - 'project' => '', - 'keyFilePath' => '', - 'bucket' => '', + 'project' => env('GOOGLE_CLOUD_PROJECT_ID', 'your-project-id'), + 'keyFilePath' => env('GOOGLE_CLOUD_KEY_FILE', null), + 'bucket' => env('GOOGLE_CLOUD_STORAGE_BUCKET', 'your-bucket'), 'root' => '', - 'prefix' => '', + 'prefix' => env('GOOGLE_CLOUD_STORAGE_PATH_PREFIX', null), ], 'rackspace' => [ 'type' => 'Rackspace', From 8dc21f3a779e19aa06bb5ae95135266f6b1e7e7f Mon Sep 17 00:00:00 2001 From: Nafies Luthfi Date: Mon, 20 Apr 2020 00:10:36 +0800 Subject: [PATCH 32/37] Add support for laravel 7 --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 6882e99..41c56a5 100644 --- a/composer.json +++ b/composer.json @@ -16,10 +16,10 @@ "require": { "backup-manager/backup-manager": "^1.0", "php": ">=5.5.0", - "symfony/process": "^2.0||^3.0||^4.0", - "illuminate/support": "^4.0||^5.0||^6.0", - "illuminate/container": "^4.0||^5.0||^6.0", - "illuminate/console": "^4.0||^5.0||^6.0" + "symfony/process": "^2.0||^3.0||^4.0||^5.0", + "illuminate/support": "^4.0||^5.0||^6.0||^7.0", + "illuminate/container": "^4.0||^5.0||^6.0||^7.0", + "illuminate/console": "^4.0||^5.0||^6.0||^7.0" }, "require-dev": { "mockery/mockery": "dev-master", From d20a3af4cade05c826098745440a2ef3e39553a6 Mon Sep 17 00:00:00 2001 From: Nafies Luthfi Date: Thu, 23 Apr 2020 07:00:10 +0800 Subject: [PATCH 33/37] Fix Process::__construct() must be of the type array, string given --- src/Laravel55ServiceProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Laravel55ServiceProvider.php b/src/Laravel55ServiceProvider.php index f0e7bd8..c71dd20 100644 --- a/src/Laravel55ServiceProvider.php +++ b/src/Laravel55ServiceProvider.php @@ -97,7 +97,7 @@ private function registerCompressorProvider() { */ private function registerShellProcessor() { $this->app->bind(\BackupManager\ShellProcessing\ShellProcessor::class, function () { - return new ShellProcessor(new Process('', null, null, null, null)); + return new ShellProcessor(new Process([], null, null, null, null)); }); } From 58ccef9882f97240c86f6d747b240dc16b5c7060 Mon Sep 17 00:00:00 2001 From: Shawn McCool Date: Thu, 30 Apr 2020 12:49:41 +0200 Subject: [PATCH 34/37] update readme for version 2.0 remove compatibility for old versions --- README.md | 45 ++++------- composer.json | 17 ++-- src/Laravel4Compatibility.php | 30 ------- src/Laravel4DbBackupCommand.php | 11 --- src/Laravel4DbListCommand.php | 11 --- src/Laravel4DbRestoreCommand.php | 11 --- src/Laravel4ServiceProvider.php | 127 ----------------------------- src/Laravel50Compatibility.php | 30 ------- src/Laravel50DbBackupCommand.php | 11 --- src/Laravel50DbListCommand.php | 11 --- src/Laravel50DbRestoreCommand.php | 11 --- src/Laravel50ServiceProvider.php | 128 ----------------------------- src/Laravel51Compatibility.php | 30 ------- src/Laravel5DbBackupCommand.php | 11 --- src/Laravel5DbListCommand.php | 11 --- src/Laravel5DbRestoreCommand.php | 11 --- src/Laravel5ServiceProvider.php | 129 ------------------------------ src/Lumen50ServiceProvider.php | 118 --------------------------- src/LumenServiceProvider.php | 119 --------------------------- 19 files changed, 22 insertions(+), 850 deletions(-) delete mode 100644 src/Laravel4Compatibility.php delete mode 100644 src/Laravel4DbBackupCommand.php delete mode 100644 src/Laravel4DbListCommand.php delete mode 100644 src/Laravel4DbRestoreCommand.php delete mode 100644 src/Laravel4ServiceProvider.php delete mode 100644 src/Laravel50Compatibility.php delete mode 100644 src/Laravel50DbBackupCommand.php delete mode 100644 src/Laravel50DbListCommand.php delete mode 100644 src/Laravel50DbRestoreCommand.php delete mode 100644 src/Laravel50ServiceProvider.php delete mode 100644 src/Laravel51Compatibility.php delete mode 100644 src/Laravel5DbBackupCommand.php delete mode 100644 src/Laravel5DbListCommand.php delete mode 100644 src/Laravel5DbRestoreCommand.php delete mode 100644 src/Laravel5ServiceProvider.php delete mode 100644 src/Lumen50ServiceProvider.php delete mode 100644 src/LumenServiceProvider.php diff --git a/README.md b/README.md index 06ba0c2..721850b 100644 --- a/README.md +++ b/README.md @@ -14,18 +14,19 @@ This package pulls in the framework agnostic [Backup Manager](https://github.com - [Scheduling Backups](#scheduling-backups) - [Contribution Guidelines](#contribution-guidelines) - [Maintainers](#maintainers) +- [Changelog](#changelog) - [License](#license) ### Stability Notice It's stable enough, you'll need to understand filesystem permissions. -This package is actively being developed and we would like to get feedback to improve it. [Please feel free to submit feedback.](https://github.com/backup-manager/laravel/issues/new) +This package is being actively developed, and we would like to get feedback to improve it. [Please feel free to submit feedback.](https://github.com/backup-manager/laravel/issues/new) ### Requirements -- PHP 5.5 -- Laravel +- PHP 7.3+ +- Laravel 5.5+ - MySQL support requires `mysqldump` and `mysql` command-line binaries - PostgreSQL support requires `pg_dump` and `psql` command-line binaries - Gzip support requires `gzip` and `gunzip` command-line binaries @@ -59,35 +60,19 @@ composer require league/flysystem-sftp composer require superbalist/flysystem-google-storage ``` -#### Laravel 4 Configuration - -To install into a Laravel 4 project, first do the composer install then add the following class to your config/app.php service providers list. - -```php -BackupManager\Laravel\Laravel4ServiceProvider::class, -``` - -Copy the `vendor/backup-manager/laravel/config/backup-manager.php` file to `app/config/backup-manager.php` and configure it to suit your needs. - #### Laravel 5 Configuration To install into a Laravel project, first do the composer install then add *ONE *of the following classes to your config/app.php service providers list. ```php -// FOR LARAVEL 5.0 ONLY -BackupManager\Laravel\Laravel50ServiceProvider::class, - -// FOR LARAVEL 5.1 - 5.4 -BackupManager\Laravel\Laravel5ServiceProvider::class, - -// FOR LARAVEL 5.5 +// FOR LARAVEL 5.5 + BackupManager\Laravel\Laravel55ServiceProvider::class, ``` Publish the storage configuration file. ```php -php artisan vendor:publish --provider="BackupManager\Laravel\Laravel5ServiceProvider" +php artisan vendor:publish --provider="BackupManager\Laravel\Laravel55ServiceProvider" ``` The Backup Manager will make use of Laravel's database configuration. But, it won't know about any connections that might be tied to other environments, so it can be best to just list multiple connections in the `config/database.php` file. @@ -103,14 +88,6 @@ BACKUP_MANAGER_EXTRA_PARAMS="--column-statistics=0 --max-allowed-packet" To install into a Lumen project, first do the composer install then add the configuration file loader and *ONE* of the following service providers to your `bootstrap/app.php`. ```php -// FOR LUMEN 5.0 ONLY -$app->configure('backup-manager'); -$app->register(BackupManager\Laravel\Lumen50ServiceProvider::class); - -// FOR LUMEN 5.1 - 5.4 -$app->configure('backup-manager'); -$app->register(BackupManager\Laravel\LumenServiceProvider::class); - // FOR LUMEN 5.5 AND ABOVE $app->configure('backup-manager'); $app->register(BackupManager\Laravel\Lumen55ServiceProvider::class); @@ -169,6 +146,16 @@ It's possible to schedule backups using Laravel's scheduler. } ``` +### Changelog + +**2.0** + +_Released on 2020-04-30_ + +Remove support for all Laravel versions below 5.5. All older versions should use the backup-manager `^1.0`. + +Since so many dependencies in Laravel / Symfony have changed it became impossible to support newer versions in the same code-base. Release `^1.0` is stable and is always accepting new stability fixes (we haven't seen anything to fix in a long time). + ### Contribution Guidelines We recommend using the vagrant configuration supplied with this package for development and contribution. Simply install VirtualBox, Vagrant, and Ansible then run `vagrant up` in the root folder. A virtualmachine specifically designed for development of the package will be built and launched for you. diff --git a/composer.json b/composer.json index 41c56a5..4d96f2b 100644 --- a/composer.json +++ b/composer.json @@ -5,21 +5,16 @@ { "name": "Shawn McCool", "email": "shawn@heybigname.com", - "homepage": "http://heybigname.com/" - }, - { - "name": "Mitchell van Wijngaarden", - "email": "mitchell@kooding.nl", - "homepage": "http://heybigname.com/" + "homepage": "https://shawnmc.cool" } ], "require": { "backup-manager/backup-manager": "^1.0", - "php": ">=5.5.0", - "symfony/process": "^2.0||^3.0||^4.0||^5.0", - "illuminate/support": "^4.0||^5.0||^6.0||^7.0", - "illuminate/container": "^4.0||^5.0||^6.0||^7.0", - "illuminate/console": "^4.0||^5.0||^6.0||^7.0" + "php": "^7.3||^7.4", + "symfony/process": "^3||^4||^5", + "illuminate/support": "^5.5||^6||^7", + "illuminate/container": "^5.5||^6||^7", + "illuminate/console": "^5.5||^6||^7" }, "require-dev": { "mockery/mockery": "dev-master", diff --git a/src/Laravel4Compatibility.php b/src/Laravel4Compatibility.php deleted file mode 100644 index 4d03e68..0000000 --- a/src/Laravel4Compatibility.php +++ /dev/null @@ -1,30 +0,0 @@ -getHelperSet()->get('table'); - } catch (InvalidArgumentException $error) { - // - } finally { - $table = new Table($this->output); - } - - $table->setHeaders($headers); - $table->setRows($rows); - $table->render($this->output); - } -} diff --git a/src/Laravel4DbBackupCommand.php b/src/Laravel4DbBackupCommand.php deleted file mode 100644 index b89b28b..0000000 --- a/src/Laravel4DbBackupCommand.php +++ /dev/null @@ -1,11 +0,0 @@ -package('backup-manager/laravel', 'backup-manager', realpath(app_path("config"))); - } - - /** - * Register the service provider. - * - * @return void - */ - public function register() { - $this->registerFilesystemProvider(); - $this->registerDatabaseProvider(); - $this->registerCompressorProvider(); - $this->registerShellProcessor(); - $this->registerArtisanCommands(); - } - - /** - * Register the filesystem provider. - * - * @return void - */ - private function registerFilesystemProvider() { - $this->app->bind(\BackupManager\Filesystems\FilesystemProvider::class, function ($app) { - $provider = new Filesystems\FilesystemProvider(new Config($app['config']['backup-manager'])); - $provider->add(new Filesystems\Awss3Filesystem); - $provider->add(new Filesystems\GcsFilesystem); - $provider->add(new Filesystems\DropboxFilesystem); - $provider->add(new Filesystems\DropboxV2Filesystem); - $provider->add(new Filesystems\FtpFilesystem); - $provider->add(new Filesystems\LocalFilesystem); - $provider->add(new Filesystems\RackspaceFilesystem); - $provider->add(new Filesystems\SftpFilesystem); - return $provider; - }); - } - - /** - * Register the database provider. - * - * @return void - */ - private function registerDatabaseProvider() { - $this->app->bind(\BackupManager\Databases\DatabaseProvider::class, function ($app) { - $provider = new Databases\DatabaseProvider($this->getDatabaseConfig($app['config']['database.connections'])); - $provider->add(new Databases\MysqlDatabase); - $provider->add(new Databases\PostgresqlDatabase); - return $provider; - }); - } - - /** - * Register the compressor provider. - * - * @return void - */ - private function registerCompressorProvider() { - $this->app->bind(\BackupManager\Compressors\CompressorProvider::class, function () { - $provider = new Compressors\CompressorProvider; - $provider->add(new Compressors\GzipCompressor); - $provider->add(new Compressors\NullCompressor); - return $provider; - }); - } - - /** - * Register the filesystem provider. - * - * @return void - */ - private function registerShellProcessor() { - $this->app->bind(\BackupManager\ShellProcessing\ShellProcessor::class, function () { - return new ShellProcessor(new Process('', null, null, null, null)); - }); - } - - /** - * Register the artisan commands. - * - * @return void - */ - private function registerArtisanCommands() { - $this->commands([ - \BackupManager\Laravel\Laravel4DbBackupCommand::class, - \BackupManager\Laravel\Laravel4DbRestoreCommand::class, - \BackupManager\Laravel\Laravel4DbListCommand::class - ]); - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() { - return [ - \BackupManager\Filesystems\FilesystemProvider::class, - \BackupManager\Databases\DatabaseProvider::class, - \BackupManager\ShellProcessing\ShellProcessor::class, - ]; - } -} diff --git a/src/Laravel50Compatibility.php b/src/Laravel50Compatibility.php deleted file mode 100644 index 69de9ed..0000000 --- a/src/Laravel50Compatibility.php +++ /dev/null @@ -1,30 +0,0 @@ -getHelperSet()->get('table'); - } catch (InvalidArgumentException $error) { - // - } finally { - $table = new Table($this->output); - } - - $table->setHeaders($headers); - $table->setRows($rows); - $table->render($this->output); - } -} diff --git a/src/Laravel50DbBackupCommand.php b/src/Laravel50DbBackupCommand.php deleted file mode 100644 index 6c5ed07..0000000 --- a/src/Laravel50DbBackupCommand.php +++ /dev/null @@ -1,11 +0,0 @@ -publishes([$configPath => config_path('backup-manager.php')], 'config'); - } - - /** - * Register the service provider. - * - * @return void - */ - public function register() { - $configPath = __DIR__ . '/../config/backup-manager.php'; - $this->mergeConfigFrom($configPath, 'backup-manager'); - $this->registerFilesystemProvider(); - $this->registerDatabaseProvider(); - $this->registerCompressorProvider(); - $this->registerShellProcessor(); - $this->registerArtisanCommands(); - } - - /** - * Register the filesystem provider. - * - * @return void - */ - private function registerFilesystemProvider() { - $this->app->bind(\BackupManager\Filesystems\FilesystemProvider::class, function ($app) { - $provider = new Filesystems\FilesystemProvider(new Config($app['config']['backup-manager'])); - $provider->add(new Filesystems\Awss3Filesystem); - $provider->add(new Filesystems\DropboxFilesystem); - $provider->add(new Filesystems\DropboxV2Filesystem); - $provider->add(new Filesystems\FtpFilesystem); - $provider->add(new Filesystems\LocalFilesystem); - $provider->add(new Filesystems\RackspaceFilesystem); - $provider->add(new Filesystems\SftpFilesystem); - return $provider; - }); - } - - /** - * Register the database provider. - * - * @return void - */ - private function registerDatabaseProvider() { - $this->app->bind(\BackupManager\Databases\DatabaseProvider::class, function ($app) { - $provider = new Databases\DatabaseProvider($this->getDatabaseConfig($app['config']['database.connections'])); - $provider->add(new Databases\MysqlDatabase); - $provider->add(new Databases\PostgresqlDatabase); - return $provider; - }); - } - - /** - * Register the compressor provider. - * - * @return void - */ - private function registerCompressorProvider() { - $this->app->bind(\BackupManager\Compressors\CompressorProvider::class, function () { - $provider = new Compressors\CompressorProvider; - $provider->add(new Compressors\GzipCompressor); - $provider->add(new Compressors\NullCompressor); - return $provider; - }); - } - - /** - * Register the filesystem provider. - * - * @return void - */ - private function registerShellProcessor() { - $this->app->bind(\BackupManager\ShellProcessing\ShellProcessor::class, function () { - return new ShellProcessor(new Process('')); - }); - } - - /** - * Register the artisan commands. - * - * @return void - */ - private function registerArtisanCommands() { - $this->commands([ - \BackupManager\Laravel\Laravel50DbBackupCommand::class, - \BackupManager\Laravel\Laravel50DbRestoreCommand::class, - \BackupManager\Laravel\Laravel50DbListCommand::class, - ]); - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() { - return [ - \BackupManager\Filesystems\FilesystemProvider::class, - \BackupManager\Databases\DatabaseProvider::class, - \BackupManager\ShellProcessing\ShellProcessor::class, - ]; - } -} diff --git a/src/Laravel51Compatibility.php b/src/Laravel51Compatibility.php deleted file mode 100644 index ae0cccc..0000000 --- a/src/Laravel51Compatibility.php +++ /dev/null @@ -1,30 +0,0 @@ -getHelperSet()->get('table'); - } catch (InvalidArgumentException $error) { - // - } finally { - $table = new Table($this->output); - } - - $table->setHeaders($headers); - $table->setRows($rows); - $table->render($this->output); - } -} diff --git a/src/Laravel5DbBackupCommand.php b/src/Laravel5DbBackupCommand.php deleted file mode 100644 index eb73cb6..0000000 --- a/src/Laravel5DbBackupCommand.php +++ /dev/null @@ -1,11 +0,0 @@ -publishes([$configPath => config_path('backup-manager.php')], 'config'); - } - - /** - * Register the service provider. - * - * @return void - */ - public function register() { - $configPath = __DIR__ . '/../config/backup-manager.php'; - $this->mergeConfigFrom($configPath, 'backup-manager'); - $this->registerFilesystemProvider(); - $this->registerDatabaseProvider(); - $this->registerCompressorProvider(); - $this->registerShellProcessor(); - $this->registerArtisanCommands(); - } - - /** - * Register the filesystem provider. - * - * @return void - */ - private function registerFilesystemProvider() { - $this->app->bind(\BackupManager\Filesystems\FilesystemProvider::class, function ($app) { - $provider = new Filesystems\FilesystemProvider(new Config($app['config']['backup-manager'])); - $provider->add(new Filesystems\Awss3Filesystem); - $provider->add(new Filesystems\GcsFilesystem); - $provider->add(new Filesystems\DropboxFilesystem); - $provider->add(new Filesystems\DropboxV2Filesystem); - $provider->add(new Filesystems\FtpFilesystem); - $provider->add(new Filesystems\LocalFilesystem); - $provider->add(new Filesystems\RackspaceFilesystem); - $provider->add(new Filesystems\SftpFilesystem); - return $provider; - }); - } - - /** - * Register the database provider. - * - * @return void - */ - private function registerDatabaseProvider() { - $this->app->bind(\BackupManager\Databases\DatabaseProvider::class, function ($app) { - $provider = new Databases\DatabaseProvider($this->getDatabaseConfig($app['config']['database.connections'])); - $provider->add(new Databases\MysqlDatabase); - $provider->add(new Databases\PostgresqlDatabase); - return $provider; - }); - } - - /** - * Register the compressor provider. - * - * @return void - */ - private function registerCompressorProvider() { - $this->app->bind(\BackupManager\Compressors\CompressorProvider::class, function () { - $provider = new Compressors\CompressorProvider; - $provider->add(new Compressors\GzipCompressor); - $provider->add(new Compressors\NullCompressor); - return $provider; - }); - } - - /** - * Register the filesystem provider. - * - * @return void - */ - private function registerShellProcessor() { - $this->app->bind(\BackupManager\ShellProcessing\ShellProcessor::class, function () { - return new ShellProcessor(new Process('', null, null, null, null)); - }); - } - - /** - * Register the artisan commands. - * - * @return void - */ - private function registerArtisanCommands() { - $this->commands([ - \BackupManager\Laravel\Laravel5DbBackupCommand::class, - \BackupManager\Laravel\Laravel5DbRestoreCommand::class, - \BackupManager\Laravel\Laravel5DbListCommand::class, - ]); - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() { - return [ - \BackupManager\Filesystems\FilesystemProvider::class, - \BackupManager\Databases\DatabaseProvider::class, - \BackupManager\ShellProcessing\ShellProcessor::class, - ]; - } -} diff --git a/src/Lumen50ServiceProvider.php b/src/Lumen50ServiceProvider.php deleted file mode 100644 index 6c878ca..0000000 --- a/src/Lumen50ServiceProvider.php +++ /dev/null @@ -1,118 +0,0 @@ -mergeConfigFrom($configPath, 'backup-manager'); - $this->registerFilesystemProvider(); - $this->registerDatabaseProvider(); - $this->registerCompressorProvider(); - $this->registerShellProcessor(); - $this->registerArtisanCommands(); - } - - /** - * Register the filesystem provider. - * - * @return void - */ - private function registerFilesystemProvider() { - $this->app->bind(\BackupManager\Filesystems\FilesystemProvider::class, function ($app) { - $provider = new Filesystems\FilesystemProvider(new Config($app['config']['backup-manager'])); - $provider->add(new Filesystems\Awss3Filesystem); - $provider->add(new Filesystems\DropboxFilesystem); - $provider->add(new Filesystems\DropboxV2Filesystem); - $provider->add(new Filesystems\FtpFilesystem); - $provider->add(new Filesystems\LocalFilesystem); - $provider->add(new Filesystems\RackspaceFilesystem); - $provider->add(new Filesystems\SftpFilesystem); - return $provider; - }); - } - - /** - * Register the database provider. - * - * @return void - */ - private function registerDatabaseProvider() { - $this->app->bind(\BackupManager\Databases\DatabaseProvider::class, function ($app) { - $provider = new Databases\DatabaseProvider($this->getDatabaseConfig($app['config']['database.connections'])); - $provider->add(new Databases\MysqlDatabase); - $provider->add(new Databases\PostgresqlDatabase); - return $provider; - }); - } - - /** - * Register the compressor provider. - * - * @return void - */ - private function registerCompressorProvider() { - $this->app->bind(\BackupManager\Compressors\CompressorProvider::class, function () { - $provider = new Compressors\CompressorProvider; - $provider->add(new Compressors\GzipCompressor); - $provider->add(new Compressors\NullCompressor); - return $provider; - }); - } - - /** - * Register the filesystem provider. - * - * @return void - */ - private function registerShellProcessor() { - $this->app->bind(\BackupManager\ShellProcessing\ShellProcessor::class, function () { - return new ShellProcessor(new Process('')); - }); - } - - /** - * Register the artisan commands. - * - * @return void - */ - private function registerArtisanCommands() { - $this->commands([ - \BackupManager\Laravel\Laravel50DbBackupCommand::class, - \BackupManager\Laravel\Laravel50DbRestoreCommand::class, - \BackupManager\Laravel\Laravel50DbListCommand::class, - ]); - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() { - return [ - \BackupManager\Filesystems\FilesystemProvider::class, - \BackupManager\Databases\DatabaseProvider::class, - \BackupManager\ShellProcessing\ShellProcessor::class, - ]; - } -} diff --git a/src/LumenServiceProvider.php b/src/LumenServiceProvider.php deleted file mode 100644 index b971f74..0000000 --- a/src/LumenServiceProvider.php +++ /dev/null @@ -1,119 +0,0 @@ -mergeConfigFrom($configPath, 'backup-manager'); - $this->registerFilesystemProvider(); - $this->registerDatabaseProvider(); - $this->registerCompressorProvider(); - $this->registerShellProcessor(); - $this->registerArtisanCommands(); - } - - /** - * Register the filesystem provider. - * - * @return void - */ - private function registerFilesystemProvider() { - $this->app->bind(\BackupManager\Filesystems\FilesystemProvider::class, function ($app) { - $provider = new Filesystems\FilesystemProvider(new Config($app['config']['backup-manager'])); - $provider->add(new Filesystems\Awss3Filesystem); - $provider->add(new Filesystems\GcsFilesystem); - $provider->add(new Filesystems\DropboxFilesystem); - $provider->add(new Filesystems\DropboxV2Filesystem); - $provider->add(new Filesystems\FtpFilesystem); - $provider->add(new Filesystems\LocalFilesystem); - $provider->add(new Filesystems\RackspaceFilesystem); - $provider->add(new Filesystems\SftpFilesystem); - return $provider; - }); - } - - /** - * Register the database provider. - * - * @return void - */ - private function registerDatabaseProvider() { - $this->app->bind(\BackupManager\Databases\DatabaseProvider::class, function ($app) { - $provider = new Databases\DatabaseProvider($this->getDatabaseConfig($app['config']['database.connections'])); - $provider->add(new Databases\MysqlDatabase); - $provider->add(new Databases\PostgresqlDatabase); - return $provider; - }); - } - - /** - * Register the compressor provider. - * - * @return void - */ - private function registerCompressorProvider() { - $this->app->bind(\BackupManager\Compressors\CompressorProvider::class, function () { - $provider = new Compressors\CompressorProvider; - $provider->add(new Compressors\GzipCompressor); - $provider->add(new Compressors\NullCompressor); - return $provider; - }); - } - - /** - * Register the filesystem provider. - * - * @return void - */ - private function registerShellProcessor() { - $this->app->bind(\BackupManager\ShellProcessing\ShellProcessor::class, function () { - return new ShellProcessor(new Process('', null, null, null, null)); - }); - } - - /** - * Register the artisan commands. - * - * @return void - */ - private function registerArtisanCommands() { - $this->commands([ - \BackupManager\Laravel\Laravel5DbBackupCommand::class, - \BackupManager\Laravel\Laravel5DbRestoreCommand::class, - \BackupManager\Laravel\Laravel5DbListCommand::class, - ]); - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() { - return [ - \BackupManager\Filesystems\FilesystemProvider::class, - \BackupManager\Databases\DatabaseProvider::class, - \BackupManager\ShellProcessing\ShellProcessor::class, - ]; - } -} From 960d8443583b3e2a7dc5cd77858106a7e44e6d9a Mon Sep 17 00:00:00 2001 From: Shawn McCool Date: Thu, 30 Apr 2020 19:11:45 +0200 Subject: [PATCH 35/37] link to open source heroes --- README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 721850b..72078ae 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,8 @@ This package pulls in the framework agnostic [Backup Manager](https://github.com - [Scheduling Backups](#scheduling-backups) - [Contribution Guidelines](#contribution-guidelines) - [Maintainers](#maintainers) -- [Changelog](#changelog) - [License](#license) +- [Changelog](#changelog) ### Stability Notice @@ -146,16 +146,6 @@ It's possible to schedule backups using Laravel's scheduler. } ``` -### Changelog - -**2.0** - -_Released on 2020-04-30_ - -Remove support for all Laravel versions below 5.5. All older versions should use the backup-manager `^1.0`. - -Since so many dependencies in Laravel / Symfony have changed it became impossible to support newer versions in the same code-base. Release `^1.0` is stable and is always accepting new stability fixes (we haven't seen anything to fix in a long time). - ### Contribution Guidelines We recommend using the vagrant configuration supplied with this package for development and contribution. Simply install VirtualBox, Vagrant, and Ansible then run `vagrant up` in the root folder. A virtualmachine specifically designed for development of the package will be built and launched for you. @@ -171,8 +161,18 @@ When contributing please consider the following guidelines: ### Maintainers -This package is maintained by [Shawn McCool](http://shawnmc.cool) and [Mitchell van Wijngaarden](http://kooding.nl). +This package is maintained by [Shawn McCool](http://shawnmc.cool) and [open-source heroes](https://github.com/backup-manager/laravel/pulls?q=is%3Apr+is%3Aclosed). ### License This package is licensed under the [MIT license](https://github.com/backup-manager/laravel/blob/master/LICENSE). + +### Changelog + +**2.0** + +_Released on 2020-04-30_ + +Remove support for all Laravel versions below 5.5. All older versions should use the backup-manager `^1.0`. + +Since so many dependencies in Laravel / Symfony have changed it became impossible to support newer versions in the same code-base. Release `^1.0` is stable and is always accepting new stability fixes (we haven't seen anything to fix in a long time). From 888929ddc22f079fcf9572c66097dfcb006825f4 Mon Sep 17 00:00:00 2001 From: Alex Fedorko Date: Fri, 29 May 2020 22:14:23 +0300 Subject: [PATCH 36/37] update backup-manager version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 4d96f2b..c23a88e 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ } ], "require": { - "backup-manager/backup-manager": "^1.0", + "backup-manager/backup-manager": "^2.0", "php": "^7.3||^7.4", "symfony/process": "^3||^4||^5", "illuminate/support": "^5.5||^6||^7", From 380ad399a027171e305cd7ccfb3d8dc5d4458f93 Mon Sep 17 00:00:00 2001 From: Alex Fedorko Date: Fri, 29 May 2020 22:29:35 +0300 Subject: [PATCH 37/37] update backup-manager version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c23a88e..89f95b3 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ } ], "require": { - "backup-manager/backup-manager": "^2.0", + "backup-manager/backup-manager": "^3.0", "php": "^7.3||^7.4", "symfony/process": "^3||^4||^5", "illuminate/support": "^5.5||^6||^7",