From d54506831d6af7105402d6ff5dc0c7eb24f3f407 Mon Sep 17 00:00:00 2001 From: marco76tv Date: Tue, 19 Nov 2024 10:25:06 +0100 Subject: [PATCH] up --- Actions/DB/DownloadAction.php | 22 +++++++++------------- Providers/EventServiceProvider.php | 4 ++-- rector.php | 6 +++--- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/Actions/DB/DownloadAction.php b/Actions/DB/DownloadAction.php index 05f3fcfb..20f57014 100755 --- a/Actions/DB/DownloadAction.php +++ b/Actions/DB/DownloadAction.php @@ -1,7 +1,9 @@ format('Y-m-d').'.gz'; - $backup_path = Storage::disk('cache')->path('backup/'.$filename); + $db = config('database.connections.' . $connectionName); + $filename = 'backup-' . $connectionName . '-' . Carbon::now()->format('Y-m-d') . '.gz'; + $backup_path = Storage::disk('cache')->path('backup/' . $filename); $backup_path = app(\Modules\Xot\Actions\File\FixPathAction::class)->execute($backup_path); app(\Modules\Xot\Actions\File\CreateDirectoryForFilenameAction::class)->execute($backup_path); - - $command = sprintf( - 'mysqldump --user=%s --password=%s %s | gzip > %s', - $db['username'], - $db['password'], - $db['database'], - $backup_path, - ); + $command = sprintf('mysqldump --user=%s --password=%s %s | gzip > %s', $db['username'], $db['password'], $db['database'], $backup_path,); LaravelProcess::run($command); - return response()->download($backup_path); } } diff --git a/Providers/EventServiceProvider.php b/Providers/EventServiceProvider.php index b8200cc3..59b999ec 100755 --- a/Providers/EventServiceProvider.php +++ b/Providers/EventServiceProvider.php @@ -1,4 +1,5 @@ > */ protected $listen = []; - - /** +/** * Indicates if events should be discovered. * * @var bool diff --git a/rector.php b/rector.php index 4679bd70..43409c5f 100755 --- a/rector.php +++ b/rector.php @@ -13,14 +13,14 @@ return static function (RectorConfig $rectorConfig): void { $rectorConfig->paths( [ - __DIR__.'', + __DIR__ . '', ] ); $rectorConfig->skip( [ - __DIR__.'/vendor', - __DIR__.'/docs', + __DIR__ . '/vendor', + __DIR__ . '/docs', ] );