Skip to content

Commit

Permalink
fix: get object size from stream where possible
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 committed Dec 5, 2024
1 parent e4d0882 commit 6cf66f9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/private/Files/ObjectStore/ObjectStoreStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,14 @@ public function file_put_contents(string $path, mixed $data): int {
}

public function writeStream(string $path, $stream, ?int $size = null): int {
if ($size === null) {
$stats = fstat($stream);
if (is_array($stats) && isset($stats['size'])) {
$size = $stats['size'];
$this->logger->warning("stream size $size");
}
}

$stat = $this->stat($path);
if (empty($stat)) {
// create new file
Expand Down

0 comments on commit 6cf66f9

Please sign in to comment.