Download the PHP package webalternatif/flysystem-openstack-swift without Composer
On this page you can find all versions of the php package webalternatif/flysystem-openstack-swift. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download webalternatif/flysystem-openstack-swift
More information about webalternatif/flysystem-openstack-swift
Files in webalternatif/flysystem-openstack-swift
Package flysystem-openstack-swift
Short Description Flysystem v3 adapter for OpenStack Swift
License MIT
Informations about the package flysystem-openstack-swift
Flysystem v3 OpenStack Swift adapter
A Flysystem v3 adapter for OpenStack Swift, using
php-opencloud/openstack.
If you're looking for a Flysystem v1 adapter, see
chrisnharvey/flysystem-openstack-swift.
Installation
Usage
Uploading large objects
To use the createLargeObject method of the underlying OpenStack library to
upload large objects (which is mandatory for files over 5 GB), you must use
the writeStream method and define the segment_size config option.
The segment_container option is also available if you want to upload segments
in another container.
Example
Generating temporary URLs
This adapter supports generating temporary URLs as described in Flysystem's documentation.
To do so, you must :
- set a secret key at the account or container level of your OpenStack Swift instance (see details in the OpenStack documentation),
- provide this secret key as third argument (
$tempUrlKey) when creating the adapter.
Available options
When calling Filesystem::temporaryUrl(), you can pass the following options as
third argument ($config):
| Option key | Description | Type | Default value |
|---|---|---|---|
digest |
The digest algorithm to use for the HMAC cryptographic signature (given as first parameter of hash_hmac). | string |
'sha256' |
file_name |
A string to override the default file name (which is based on the object name) when the file is downloaded. | string |
null |
prefix |
If true, a prefix-based temporary URL will be generated. |
bool |
false |
Those option keys are available as public constants in the
Webf\Flysystem\OpenStackSwift\Config class.
More information about those options can be found in the OpenStack documentation.
Example
Tests
This library uses the FilesystemAdapterTestCase provided by
league/flysystem-adapter-test-utilities, so it performs integration tests
that need a real OpenStack Swift container.
To run tests, duplicate the phpunit.xml.dist file into phpunit.xml and fill
all the environment variables, then run:
This will run Psalm and PHPUnit, but you can run them individually like this:
All versions of flysystem-openstack-swift with dependencies
php-opencloud/openstack Version ^3.1
league/flysystem Version ^3.0