Skip to content

Commit

Permalink
Fix regression on missing resource put
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jaapio committed Mar 10, 2025
1 parent b6bec6f commit fc5f4db
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/filesystem/src/FileSystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
6 changes: 6 additions & 0 deletions packages/filesystem/src/FlySystemAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
6 changes: 6 additions & 0 deletions packages/filesystem/src/FlysystemV1/FlysystemV1.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
6 changes: 6 additions & 0 deletions packages/filesystem/src/FlysystemV3/FlysystemV3.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit fc5f4db

Please sign in to comment.