承接 nimbusoft/flysystem-openstack-swift 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nimbusoft/flysystem-openstack-swift

最新稳定版本:1.5.0

Composer 安装命令:

composer require nimbusoft/flysystem-openstack-swift

包简介

Flysystem adapter for OpenStack Swift

README 文档

README

Author Tests Software License Packagist Version Total Downloads

Flysystem adapter for OpenStack Swift.

Installation

composer require nimbusoft/flysystem-openstack-swift

Usage

$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);

Configuration

The Swift adapter has the following configuration options:

Uploading large objects

See more at openstack documentation

  • swiftLargeObjectThreshold: Size of the file in bytes when to switch over to the large object upload procedure. Default is 300 MiB. The maximum allowed size of regular objects is 5 GiB.
  • swiftSegmentSize: Size of individual segments or chunks that the large file is split up into. Default is 100 MiB. Should be below 5 GiB.
  • swiftSegmentContainer: Name of the Swift container to store the large object segments to. Default is the same container that stores the regular files.

Content type

  • contentType: Sets the Content-Type header of the request.
  • detectContentType: If set to true, Object Storage guesses the content type based on the file extension and ignores the value sent in the Content-Type header, if present.

File expiration

  • deleteAfter: Specifies the number of seconds after which the object is removed. Internally, the Object Storage system stores this value in the X-Delete-At metadata item.
  • deleteAt: The certain date, in the UNIX Epoch timestamp format, when the object will be removed.

Examples

These options can be set on Filesystem creation:

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

or per-file:

$flysystem->write($path, $contents, new \League\Flysystem\Config([
    'swiftLargeObjectThreshold' => 52428800, // 50 MiB
    'contentType' => 'text/plain',
    'deleteAfter' => 3600, // 1 hour
])

统计信息

  • 总下载量: 738.89k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 45
  • 点击次数: 1
  • 依赖项目数: 6
  • 推荐数: 2

GitHub 信息

  • Stars: 45
  • Watchers: 5
  • Forks: 20
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-08-26