Skip to content

Listing contents cannot show the top directory non-recursively #55

@ahmadfadlydziljalal

Description

@ahmadfadlydziljalal

With this package on composer.json:

 "creocoder/yii2-flysystem": "^1.1",                     [1.1.0]
 "league/flysystem-aws-s3-v3": "~1.0",              [1.0.30]

Then, In Yii2 config:

'components' => [
        'aws' => [
            'class' => 'creocoder\flysystem\AwsS3Filesystem',
            'key' => getenv('SPACES_DO_KEY'),
            'secret' => getenv('SPACES_DO_SECRET'),
            'bucket' => 'my-bucket-in-digitalocean',
            'region' => 'sgp1',
            'version' => 'latest',
            'endpoint' => 'https://sgp1.digitaloceanspaces.com',
        ],
]

Works, If we doing this:

$contents = Yii::$app->aws->listContents("/");
die(Html::tag('pre', VarDumper::dumpAsString($contents)));

Result:
[
    0 => [
        'path' => 'delivery_order'
        'dirname' => ''
        'basename' => 'delivery_order'
        'filename' => 'delivery_order'
        'type' => 'dir'
    ]
    1 => [
        'path' => 'goods'
        'dirname' => ''
        'basename' => 'goods'
        'filename' => 'goods'
        'type' => 'dir'
    ]
]

But not works for:

$contents = Yii::$app->aws->listContents("/delivery_order");
die(Html::tag('pre', VarDumper::dumpAsString($contents)));

Result:
[ ] // an empty array

Please advice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions