Skip to content

Commit

Permalink
fix: s3 config error
Browse files Browse the repository at this point in the history
  • Loading branch information
zgq354 committed Dec 7, 2023
1 parent e48f391 commit ca5a90f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Extend/DiskS3/DiskS3Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,22 @@
use Illuminate\Filesystem\FilesystemAdapter;
use Illuminate\Support\Arr;
use League\Flysystem\Filesystem;
use League\Flysystem\Config as FlyConfig;

class DiskS3Driver implements DriverInterface
{
public function build(string $diskName, SettingsRepositoryInterface $settings, Config $config, array $localConfig): Cloud
{
$s3Config = $this->formatS3Config($config['disk_s3_config']);
$root = $diskName;
$options = $config['options'] ?? [];
$streamReads = $config['stream_reads'] ?? false;
$options = $s3Config['options'] ?? [];
$streamReads = $s3Config['stream_reads'] ?? false;
$publicBaseUrl = $s3Config['public_base_url'] ?? null;
$flyConfig = $s3Config['fly_config'] ?? [];

return new FilesystemAdapter(new Filesystem(
new DiskS3Adapter(new S3Client($s3Config), $s3Config['bucket'], $root, $options, $streamReads, $publicBaseUrl)
new DiskS3Adapter(new S3Client($s3Config), $s3Config['bucket'], $root, $options, $streamReads, $publicBaseUrl),
new FlyConfig($flyConfig),
));
}

Expand Down

0 comments on commit ca5a90f

Please sign in to comment.