mzur/flysystem-openstack-swift

此包已被放弃,不再维护。作者建议使用 nimbusoft/flysystem-openstack-swift 包。

OpenStack Swift 的 Flysystem 适配器

v1.1.0 2019-09-17 10:50 UTC

This package is auto-updated.

Last update: 2019-11-17 17:37:39 UTC


README

Build Status Software License Packagist Version

OpenStack Swift 的 Flysystem 适配器。

存档。请使用 nimbusoftltd/flysystem-openstack-swift

安装

composer require mzur/flysystem-openstack-swift

用法

$openstack = new OpenStack\OpenStack([
    'authUrl' => '{authUrl}',
    'region'  => '{region}',
    'user'    => [
        'id'       => '{userId}',
        'password' => '{password}'
    ],
    'scope'   => ['project' => ['id' => '{projectId}']]
]);

$container = $openstack->objectStoreV1()
    ->getContainer('{containerName}');

$adapter = new Nimbusoft\Flysystem\OpenStack\SwiftAdapter($container);

$flysystem = new League\Flysystem\Filesystem($adapter);

配置

Swift 适配器允许您配置上传 大对象 的行为。您可以设置以下配置选项

  • swiftLargeObjectThreshold: 文件大小(字节),超过该大小将切换到大对象上传过程。默认是 300 MiB。常规对象的最大允许大小是 5 GiB。
  • swiftSegmentSize: 大文件拆分成的单个段或块的大小。默认是 100 MiB。应小于 5 GiB。
  • swiftSegmentContainer: 存储大对象段的 Swift 容器名称。默认与存储常规文件的容器相同。

示例


$flysystem = new League\Flysystem\Filesystem($adapter, new \League\Flysystem\Config([
    'swiftLargeObjectThreshold' => 104857600, // 100 MiB
    'swiftSegmentSize' => 52428800, // 50 MiB
    'swiftSegmentContainer' => 'mySegmentContainer',
]));