src/Components/S3FileSystem.php
public function listBlobs($container = '', $prefix = '', $delimiter = '')
    {
        $options = [
            'Bucket'  => $container,
            'Prefix'  => $prefix,
            'MaxKeys' => 1000
        ];

        if (!empty($delimiter)) {
            $options['Delimiter'] = $delimiter;
        }

        //	No max-keys specified. Get everything.
        $keys = [];

        do {
            /** @var \Aws\Result $list */
            $list = $this->blobConn->listObjects($options);

            $objects = $list->get('Contents');

            if (!empty($objects)) {
                foreach ($objects as $object) {
                    if (0 != strcasecmp($prefix, $object['Key'])) {
                        $keys[$object['Key']] = true;
                    }
                }
            }

            $objects = $list->get('CommonPrefixes');

            if (!empty($objects)) {
                foreach ($objects as $object) {
                    if (0 != strcasecmp($prefix, $object['Prefix'])) {
                        if (!isset($keys[$object['Prefix']])) {
                            $keys[$object['Prefix']] = false;
                        }
                    }
                }
            }

            $options['Marker'] = $list->get('NextMarker');
        } while ($list->get('IsTruncated'));

        $options = [
            'Bucket' => $container,
            'Key'    => ''
        ];

        $out = [];
        foreach ($keys as $key => $isObject) {
            $options['Key'] = $key;

            if ($isObject) {
                /** @var \Aws\Result $meta */
                $meta = $this->blobConn->headObject($options);

                $out[] = [
                    'name'           => $key,
                    'content_type'   => $meta->get('ContentType'),
                    'content_length' => intval($meta->get('ContentLength')),
                    'last_modified'  => $meta->get('LastModified')
                ];
            } else {
                $out[] = [
                    'name'           => $key,
                    'content_type'   => null,
                    'content_length' => 0,
                    'last_modified'  => null
                ];
            }
        }

        return $out;
    }
public function listBlobs($container = '', $prefix = '', $delimiter = '')
    {
        $options = [
            'Bucket'  => $container,
            'Prefix'  => $prefix,
            'MaxKeys' => 1000
        ];

        if (!empty($delimiter)) {
            $options['Delimiter'] = $delimiter;
        }

        //	No max-keys specified. Get everything.
        $keys = [];

        do {
            /** @var \Aws\Result $list */
            $list = $this->blobConn->listObjects($options);

            $objects = $list->get('Contents');

            if (!empty($objects)) {
                foreach ($objects as $object) {
                    if (0 != strcasecmp($prefix, $object['Key'])) {
                        $keys[$object['Key']] = true;
                    }
                }
            }

            $objects = $list->get('CommonPrefixes');

            if (!empty($objects)) {
                foreach ($objects as $object) {
                    if (0 != strcasecmp($prefix, $object['Prefix'])) {
                        if (!isset($keys[$object['Prefix']])) {
                            $keys[$object['Prefix']] = false;
                        }
                    }
                }
            }

            $options['Marker'] = $list->get('NextMarker');
        } while ($list->get('IsTruncated'));

        $options = [
            'Bucket' => $container,
            'Key'    => ''
        ];

        $out = [];
        foreach ($keys as $key => $isObject) {
            $options['Key'] = $key;

            if ($isObject) {
                /** @var \Aws\Result $meta */
                $meta = $this->blobConn->headObject($options);

                $out[] = [
                    'name'           => $key,
                    'content_type'   => $meta->get('ContentType'),
                    'content_length' => intval($meta->get('ContentLength')),
                    'last_modified'  => $meta->get('LastModified')
                ];
            } else {
                $out[] = [
                    'name'           => $key,
                    'content_type'   => null,
                    'content_length' => 0,
                    'last_modified'  => null
                ];
            }
        }

        return $out;
    }
List blobs

@param  string $container Container name
@param  string $prefix    Optional. Filters the results to return only blobs whose name begins with the
specified prefix.
@param  string $delimiter Optional. Delimiter, i.e. '/', for specifying folder hierarchy

@return array
@throws DfException