cdwv/database-dumper-command-bundle
Symfony bundle adding a console command to create database backups/dumps. Install via Composer, register the bundle, then run app/console cdwv:database:dump to generate a dump for your configured database.
artisan commands).AppKernel and Console components, requiring abstraction layers for Laravel integration.spatie/laravel-backup).artisan db:dump or mysqldump wrappers).Console component (already present in Laravel via illuminate/console).DependencyInjection (DI) container, necessitating a Laravel-compatible adapter (e.g., symfony/dependency-injection + custom bridge).DB facade abstracts this better).AppKernel registration) adds technical debt.spatie/laravel-backup, laravel-backup).artisan db:dump (via doctrine/dbal). What unique value does this bundle offer?Artisan command using Symfony’s Console component as a dependency.// app/Console/Commands/DumpDatabase.php
use Symfony\Component\Console\Application;
use CodeWave\DatabaseDumperCommandBundle\Command\DatabaseDumpCommand;
class DumpDatabase extends Command {
protected $signature = 'db:dump-legacy';
public function handle() {
$symfonyApp = new Application();
$symfonyApp->add(new DatabaseDumpCommand());
$symfonyApp->run();
}
}
Artisan command using DBAL or mysqldump directly (lower risk).symfony/console (already in Laravel) and symfony/dependency-injection (additive).config/app.php (if using Option 1).spatie/laravel-backup (3+ years of updates).CodeWaveDatabaseDumperCommandBundle class.DB facade supports more (SQLite, PostgreSQL, etc.).artisan db:dump or spatie/laravel-backup as a stopgap.AppKernel with Laravel’s ServiceProvider).laravel-backup) or build a custom solution.symfony/dependency-injection increases attack surface.spatie/laravel-backup (active maintenance, 10K+ downloads/month).Artisan command (50 lines of code).DBAL or mysqldump wrappers offer better control (e.g., --single-transaction).aws s3 cp).| Risk | Impact | Mitigation |
|---|---|---|
| Symfony 2.x Breakage | CLI command fails on PHP 8.x | Fork and update dependencies |
| Database Corruption | Malformed dump due to unsanitized input | Validate inputs; use Laravel’s DB facade |
| Dependency Conflicts | Symfony/Laravel version clashes | Isolate in a separate Docker container |
| Security Vulnerabilities | Unpatched Symfony components | Replace with maintained package |
AppKernel and Console components is non-trivial for Laravel teams.Avoid adoption unless:
Preferred Path:
spatie/laravel-backup (if advanced features are needed).Artisan command (if simplicity is the goal). Example:
// app/Console/Commands/DumpDatabase.php
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Artisan;
class DumpDatabase extends Command {
protected $signature = 'db:dump {--compress}';
public function handle() {
$dump = Artisan::call('db:dump', ['--no-interaction' => true]);
if ($this->option('compress')) {
file_put_contents(
'backup.sql.gz',
gzencode($dump->output())
);
}
}
}
How can I help you explore Laravel packages today?