Skip to content

Move extra params definition to backup manager config #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
3 changes: 3 additions & 0 deletions config/backup-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,7 @@
'privateKey' => '',
'root' => '',
],

// Add additional options to dump-command (like '--max-allowed-packet')
'command-extra-params' => env('BACKUP_MANAGER_EXTRA_PARAMS'),
];
3 changes: 1 addition & 2 deletions src/GetDatabaseConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => '--column-statistics=0',
'extraParams' => config('backup-manager.command-extra-params'),
];
}, $connections);
return new Config($mapped);
Expand Down