diff --git a/packages/filesystem/src/FileSystem.php b/packages/filesystem/src/FileSystem.php index 107fce6bb..ceb322027 100644 --- a/packages/filesystem/src/FileSystem.php +++ b/packages/filesystem/src/FileSystem.php @@ -46,6 +46,9 @@ public function read(string $path): string|false; public function put(string $path, string $contents): bool; + /** @param resource $resource */ + public function putStream(string $path, $resource): void; + /** @return StorageAttributes[] */ public function listContents(string $directory = '', bool $recursive = false): array; diff --git a/packages/filesystem/src/FlySystemAdapter.php b/packages/filesystem/src/FlySystemAdapter.php index 80591da08..329187561 100644 --- a/packages/filesystem/src/FlySystemAdapter.php +++ b/packages/filesystem/src/FlySystemAdapter.php @@ -75,6 +75,12 @@ public function put(string $path, string $contents): bool return $this->filesystem->put($path, $contents); } + /** @param resource $resource */ + public function putStream(string $path, $resource): void + { + $this->filesystem->putStream($path, $resource); + } + /** @return StorageAttributes[] */ public function listContents(string $directory = '', bool $recursive = false): array { diff --git a/packages/filesystem/src/FlysystemV1/FlysystemV1.php b/packages/filesystem/src/FlysystemV1/FlysystemV1.php index c8515bb2d..1a4698e6d 100644 --- a/packages/filesystem/src/FlysystemV1/FlysystemV1.php +++ b/packages/filesystem/src/FlysystemV1/FlysystemV1.php @@ -52,6 +52,12 @@ public function put(string $path, string $contents): bool return $this->filesystem->put($path, $contents); } + /** @param resource $resource */ + public function putStream(string $path, $resource): void + { + $this->filesystem->putStream($path, $resource); + } + /** @return StorageAttributes[] */ public function listContents(string $directory = '', bool $recursive = false): array { diff --git a/packages/filesystem/src/FlysystemV3/FlysystemV3.php b/packages/filesystem/src/FlysystemV3/FlysystemV3.php index 0d1bdeb11..c5e9ce84a 100644 --- a/packages/filesystem/src/FlysystemV3/FlysystemV3.php +++ b/packages/filesystem/src/FlysystemV3/FlysystemV3.php @@ -52,6 +52,12 @@ public function put(string $path, string $contents): bool return true; } + /** @param resource $resource */ + public function putStream(string $path, $resource): void + { + $this->filesystem->writeStream($path, $resource); + } + /** @return FileAttributes[] */ public function listContents(string $directory = '', bool $recursive = false): array {