Skip to content
This repository has been archived by the owner on Nov 18, 2019. It is now read-only.

OpenStack Swift adapter for Flysystem

License

Notifications You must be signed in to change notification settings

mzur/flysystem-openstack-swift

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flysystem Adapter for OpenStack Swift

Build Status Software License Packagist Version

Flysystem adapter for OpenStack Swift.

Archived. Use nimbusoftltd/flysystem-openstack-swift instead.

Installation

composer require mzur/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 allows you to configure the behavior of uploading large objects. You can set the following configuration options:

  • 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.

Example:

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

About

OpenStack Swift adapter for Flysystem

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%