overtrue / flysystem-cos

:floppy_disk: Flysystem adapter for the Qcloud COS storage.
74 stars 10 forks source link

fix:修复获取临时连接的兼容 #42

Closed hepeichun closed 3 months ago

hepeichun commented 3 months ago
# vendor/league/flysystem/src/Filesystem.php
public function temporaryUrl(string $path, DateTimeInterface $expiresAt, array $config = []): string
    {
        $generator = $this->temporaryUrlGenerator ?? $this->adapter;

        if ($generator instanceof TemporaryUrlGenerator) {
            return $generator->temporaryUrl(
                $this->pathNormalizer->normalizePath($path),
                $expiresAt,
                $this->config->extend($config)
            );
        }

        throw UnableToGenerateTemporaryUrl::noGeneratorConfigured($path);
    }

这里的$generator instanceof TemporaryUrlGenerator会检查