Skip to content

windows 开发环境下Storage::allDirectories()不起作用 #98

@jeristiano

Description

@jeristiano

windows 环境下 php 8.2 + laravel 10 调用 Storage::allDirectories('base') 无法获得 该目录下所有的文件夹,经过查询问题在:

\Iidestiny\Flysystem\Oss\OssAdapter

public function __construct($accessKeyId, $accessKeySecret, $endpoint, $bucket, bool $isCName = false, string $prefix = '', array $buckets = [], ...$params)
    {
        $this->accessKeyId = $accessKeyId;
        $this->accessKeySecret = $accessKeySecret;
        $this->endpoint = $endpoint;
        $this->bucketName = $bucket;
        $this->isCName = $isCName;
        $this->prefixer = new PathPrefixer($prefix, DIRECTORY_SEPARATOR); //此处 DIRECTORY_SEPARATOR 在 windows 环境下 会被 解析成 ‘/’,oos无法解析,导致最终无法获取目录。
        $this->buckets = $buckets;
        $this->params = $params;
        $this->initDefaultBucketAdapter();
    }

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