public static createFromArray ( array $config ) : |
||
$config | array | |
Résultat |
public function handle() { consoleOutput()->comment('Starting cleanup...'); try { $config = config('laravel-backup'); $backupDestinations = BackupDestinationFactory::createFromArray($config['backup']); $strategy = app($config['cleanup']['strategy']); $cleanupJob = new CleanupJob($backupDestinations, $strategy); $cleanupJob->run(); consoleOutput()->comment('Cleanup completed!'); } catch (Exception $exception) { event(new CleanupHasFailed($exception)); return -1; } }
public static function createFromArray(array $config) : BackupJob { return (new BackupJob())->setFileSelection(static::createFileSelection($config['backup']['source']['files']))->setDbDumpers(static::createDbDumpers($config['backup']['source']['databases']))->setBackupDestinations(BackupDestinationFactory::createFromArray($config['backup'])); }