public function listBlobs($container, $prefix = '', $delimiter = '')
    {
        $allFiles = $this->gridFind();
        $return = [];
        foreach ($allFiles as $fileObj) {
            $return[] = $this->getBlobMeta($fileObj);
        }

        /** If we have a delimiter (directory), there is no method in GridFS library to get only records under
         * the delimiter as in AWS s3, so we need to manually filter out. First reduce down dirs to passed $prefix */
        $reduced = [];
        foreach ($return as &$filterBlob) {
            if (strpos($filterBlob['path'], $prefix) !== false) {
                $reduced[] = $filterBlob;
            }
        }

        if (empty($reduced) && !empty($prefix)) {
            return [];
        }

        $reduced = (empty($reduced)) ? $return : $reduced;

        return $this->filterPaths($prefix, $delimiter, $reduced);
    }
public function listBlobs($container, $prefix = '', $delimiter = '')
    {
        $allFiles = $this->gridFind();
        $return = [];
        foreach ($allFiles as $fileObj) {
            $return[] = $this->getBlobMeta($fileObj);
        }

        /** If we have a delimiter (directory), there is no method in GridFS library to get only records under
         * the delimiter as in AWS s3, so we need to manually filter out. First reduce down dirs to passed $prefix */
        $reduced = [];
        foreach ($return as &$filterBlob) {
            if (strpos($filterBlob['path'], $prefix) !== false) {
                $reduced[] = $filterBlob;
            }
        }

        if (empty($reduced) && !empty($prefix)) {
            return [];
        }

        $reduced = (empty($reduced)) ? $return : $reduced;

        return $this->filterPaths($prefix, $delimiter, $reduced);
    }
public function listBlobs ( $ container , $ prefix = '' , $ delimiter = '' ) { $ allFiles = $ this -> gridFind ( ) ; $ return = [ ] ; foreach ( $ allFiles as $ fileObj ) { $ return [ ] = $ this -> getBlobMeta ( $ fileObj ) ; } /** If we have a delimiter (directory), there is no method in GridFS library to get only records under
         * the delimiter as in AWS s3, so we need to manually filter out. First reduce down dirs to passed $prefix */ $ reduced = [ ] ; foreach ( $ return as & $ filterBlob ) { if ( strpos ( $ filterBlob [ 'path' ] , $ prefix ) !== false ) { $ reduced [ ] = $ filterBlob ; } } if ( empty ( $ reduced ) && ! empty ( $ prefix ) ) { return [ ] ; } $ reduced = ( empty ( $ reduced ) ) ? $ return : $ reduced ; return $ this -> filterPaths ( $ prefix , $ delimiter , $ reduced ) ; }
main function to list blobs within a folder, etc.

@param string $container
@param string $prefix
@param string $delimiter - if full_tree is true, delimeter will be empty.

@return array
main function to list blobs within a folder etc .