Skip to content

Commit

Permalink
Merge pull request #36 from cp6/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
cp6 authored May 14, 2024
2 parents 1a67b8e + 107fe8a commit c64a4be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ Get directory size
<span id="get-directory-size"></span>

```php
$dir = "profiles/admin/images";

$bunny->dirSize($dir);
```

Expand Down
2 changes: 1 addition & 1 deletion src/BunnyAPIStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function getFileSize(string $file): int

public function dirSize(string $dir = ''): array
{
$array = json_decode(file_get_contents(self::STORAGE_API_URL . "/$this->storage_name" . $dir . "/?AccessKey=" . $this->access_key), true);
$array = json_decode(file_get_contents(self::STORAGE_API_URL . "/$this->storage_name/" . $dir . "/?AccessKey=" . $this->access_key), true);
$size = $files = 0;
foreach ($array as $value) {
if ($value['IsDirectory'] === false) {
Expand Down

0 comments on commit c64a4be

Please sign in to comment.