Skip to content

Commit fc5f4db

Browse files
committed
Fix regression on missing resource put
Some external libraries did rely on the usage of putResource. This method wasn't part of the new filesystem interface and was therefore breaking those implementations.
1 parent b6bec6f commit fc5f4db

File tree

4 files changed

+21
-0
lines changed

4 files changed

+21
-0
lines changed

packages/filesystem/src/FileSystem.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ public function read(string $path): string|false;
4646

4747
public function put(string $path, string $contents): bool;
4848

49+
/** @param resource $resource */
50+
public function putStream(string $path, $resource): void;
51+
4952
/** @return StorageAttributes[] */
5053
public function listContents(string $directory = '', bool $recursive = false): array;
5154

packages/filesystem/src/FlySystemAdapter.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ public function put(string $path, string $contents): bool
7575
return $this->filesystem->put($path, $contents);
7676
}
7777

78+
/** @param resource $resource */
79+
public function putStream(string $path, $resource): void
80+
{
81+
$this->filesystem->putStream($path, $resource);
82+
}
83+
7884
/** @return StorageAttributes[] */
7985
public function listContents(string $directory = '', bool $recursive = false): array
8086
{

packages/filesystem/src/FlysystemV1/FlysystemV1.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ public function put(string $path, string $contents): bool
5252
return $this->filesystem->put($path, $contents);
5353
}
5454

55+
/** @param resource $resource */
56+
public function putStream(string $path, $resource): void
57+
{
58+
$this->filesystem->putStream($path, $resource);
59+
}
60+
5561
/** @return StorageAttributes[] */
5662
public function listContents(string $directory = '', bool $recursive = false): array
5763
{

packages/filesystem/src/FlysystemV3/FlysystemV3.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ public function put(string $path, string $contents): bool
5252
return true;
5353
}
5454

55+
/** @param resource $resource */
56+
public function putStream(string $path, $resource): void
57+
{
58+
$this->filesystem->writeStream($path, $resource);
59+
}
60+
5561
/** @return FileAttributes[] */
5662
public function listContents(string $directory = '', bool $recursive = false): array
5763
{

0 commit comments

Comments
 (0)