ToshY / BunnyNet-PHP

Bunny.net CDN API PHP library.
https://toshy.github.io/BunnyNet-PHP/
MIT License
44 stars 7 forks source link

[Feature]: Add discussions to this repo #122

Closed tacman closed 6 months ago

tacman commented 6 months ago

Description

I have some questions that are neither bug reports nor feature requests, would you consider enabling Discussions?

Example

Is there a way to download the metadata of all the objects in a storageZone? Obviously, a recursive function that calls listFiles() and/or listContents() would work, but generate many API calls if there are a lot of directories.

I have a million objects, each object has 0 or more photos and the photos and metadata for each object is in a directory keyed by the object id. S3 doesn't really have directories, so this approach is fine, but I'm wondering if I need to restructure if we migrate to Bunny.

            $list = $edgeStorageApi->listFiles(
                storageZoneName: $storageZoneName,
                path: '/'
            );

            foreach ($list->getContents() as $fileInfo) {
                $subList = $edgeStorageApi->listFiles(
                    $storageZoneName,
                    path: $fileInfo['ObjectName']
                );

               // @todo: add recursive call

            }