Skip to content

Commit

Permalink
Fix Errors during Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
wattnpapa committed Nov 30, 2024
1 parent 0b74f72 commit 1e2822d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Commands/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function handle()
}

$extraOptions = $this->option('extraOptions') ?: config('db-snapshots.extraOptions', []);
$extraOptions = is_string($extraOptions) ? explode(',', $exclude) : $exclude;
$extraOptions = is_string($extraOptions) ? explode(',', $extraOptions) : $extraOptions;


$snapshot = app(SnapshotFactory::class)->create(
Expand Down
3 changes: 2 additions & 1 deletion src/Events/CreatingSnapshot.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ public function __construct(
public FilesystemAdapter $disk,
public string $connectionName,
public ?array $tables = null,
public ?array $exclude = null
public ?array $exclude = null,
public ?array $extraOptions = null
) {
//
}
Expand Down
7 changes: 4 additions & 3 deletions src/SnapshotFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ public function create(string $snapshotName, string $diskName, string $connectio
$disk,
$connectionName,
$tables,
$exclude
$exclude,
$extraOptions
));

$this->createDump($connectionName, $fileName, $disk, $compress, $tables, $exclude);
$this->createDump($connectionName, $fileName, $disk, $compress, $tables, $exclude, $extraOptions);

$snapshot = new Snapshot($disk, $fileName);

Expand All @@ -64,7 +65,7 @@ protected function getDbDumper(string $connectionName): DbDumper
return $factory::createForConnection($connectionName);
}

protected function createDump(string $connectionName, string $fileName, FilesystemAdapter $disk, bool $compress = false, ?array $tables = null, ?array $exclude = null): void
protected function createDump(string $connectionName, string $fileName, FilesystemAdapter $disk, bool $compress = false, ?array $tables = null, ?array $exclude = null, array $extraOptions = []): void
{
$directory = (new TemporaryDirectory(config('db-snapshots.temporary_directory_path')))->create();

Expand Down

0 comments on commit 1e2822d

Please sign in to comment.