2017 © Pedro Peláez
 

library flysystem-selectel

Flysystem adapter for Selectel Cloud Storage

image

argentcrusade/flysystem-selectel

Flysystem adapter for Selectel Cloud Storage

  • Wednesday, September 27, 2017
  • by tzurbaev
  • Repository
  • 1 Watchers
  • 7 Stars
  • 6,234 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 8 Versions
  • 41 % Grown

The README.md

Flysystem Adapter for Selectel Cloud Storage

Build Status ![StyleCI][ico-styleci] ScrutinizerCI Latest Version on Packagist ![Software License][ico-license], (*1)

Requirements

This package requires PHP 5.6 or higher., (*2)

Installation

You can install the package via composer:, (*3)

``` bash $ composer require argentcrusade/flysystem-selectel, (*4)


## Upgrade ### From 1.0* to 1.1.0 New setting `container_url` was added. You can set your container's custom domain here (for example, `https://static.example.org`) and this option will be used when retrieving fully qualified URLs to files and directories. ## Usage ``` php use ArgentCrusade\Flysystem\Selectel\SelectelAdapter; use ArgentCrusade\Selectel\CloudStorage\Api\ApiClient; use ArgentCrusade\Selectel\CloudStorage\CloudStorage; use League\Flysystem\Filesystem; $api = new ApiClient('selectel-username', 'selectel-password'); $storage = new CloudStorage($api); $container = $storage->getContainer('container-name'); $adapter = new SelectelAdapter($container); $filesystem = new Filesystem($adapter);

Laravel Integration

You can use this adapter with Laravel's Storage System., (*5)

If you're running Laravel 5.5+ this package will auto-added to your providers list via auto-discovery feature (requires version 1.2+ of this package)., (*6)

Laravel <= 5.4

Add ArgentCrusade\Flysystem\Selectel\SelectelServiceProvider::class to your providers list in config/app.php, (*7)

/*
 * Package Service Providers...
 */
ArgentCrusade\Flysystem\Selectel\SelectelServiceProvider::class,

All Laravel versions

Add selectel disk to config/filesystems.php configuration file (disks section):, (*8)

'selectel' => [
    'driver' => 'selectel',
    'username' => 'selectel-username',
    'password' => 'selectel-password',
    'container' => 'selectel-container',
    'container_url' => 'https://static.example.org',
]

container_url setting (new in version 1.1.0) allows you to override default Selectel's CDN domain (if you have custom domain attached). You may omit this setting if you're using default domain, file URLs will look like http://XXX.selcdn.ru/container_name/path/to/file.txt, where XXX - your unique subdomain (X-Storage-Url header value)., (*9)

Now you can use Selectel disk as, (*10)

use Illuminate\Support\Facades\Storage;

Storage::disk('selectel')->put('file.txt', 'Hello world');

Also you may want to set selectel as default disk to ommit disk('selectel') calls and use storage just as Storage::put('file.txt', 'Hello world')., (*11)

For more info please refer to Laravel's Storage System documentation., (*12)

Unsupported methods

Due to the implementation of the Selectel API some methods are missing or may not function as expected., (*13)

Visibility management

Selectel provides visibility support only for Containers, but not for files. The change of visibility for the entire container instead of a single file/directory may be confusing for adapter users. Adapter will throw LogicException on getVisibility/setVisbility calls., (*14)

Directories management

Currently Selectel Adapter can display and delete only those directories that were created via createDir method. Dynamic directories (those that were created via write/writeStream methods) can not be deleted or listed as directory., (*15)

$fs = new Filesystem($adapter);

$fs->createDir('images'); // The 'images' directory can be deleted and will be listed as 'dir' in the results of `$fs->listContents()`.

$fs->write('documents/hello.txt'); // The 'documents' directory can not be deleted and won't be listed in the results of `$fs->listContents()`.

Note on Closing Streams

Selectel Adapter leaves the streams open after consuming them. Make sure that you've closed all streams that you opened., (*16)

Change log

Please see CHANGELOG for more information on what has changed recently., (*17)

Testing

bash $ vendor/bin/phpunit, (*18)

Contributing

Please see CONTRIBUTING for details., (*19)

Security

If you discover any security related issues, please email zurbaev@gmail.com instead of using the issue tracker., (*20)

License

The MIT License (MIT). Please see License File for more information., (*21)

The Versions

27/09 2017

dev-master

9999999-dev https://github.com/argentcrusade/flysystem-selectel

Flysystem adapter for Selectel Cloud Storage

  Sources   Download

MIT

The Requires

 

The Development Requires

flysystem selectel

27/09 2017

1.2.0

1.2.0.0 https://github.com/argentcrusade/flysystem-selectel

Flysystem adapter for Selectel Cloud Storage

  Sources   Download

MIT

The Requires

 

The Development Requires

flysystem selectel

26/07 2017

1.1.2

1.1.2.0 https://github.com/argentcrusade/flysystem-selectel

Flysystem adapter for Selectel Cloud Storage

  Sources   Download

MIT

The Requires

 

The Development Requires

flysystem selectel

18/04 2017

1.1.1

1.1.1.0 https://github.com/argentcrusade/flysystem-selectel

Flysystem adapter for Selectel Cloud Storage

  Sources   Download

MIT

The Requires

 

The Development Requires

flysystem selectel

18/04 2017

1.1.0

1.1.0.0 https://github.com/argentcrusade/flysystem-selectel

Flysystem adapter for Selectel Cloud Storage

  Sources   Download

MIT

The Requires

 

The Development Requires

flysystem selectel

11/03 2017

1.0.1

1.0.1.0 https://github.com/argentcrusade/flysystem-selectel

Flysystem adapter for Selectel Cloud Storage

  Sources   Download

MIT

The Requires

 

The Development Requires

flysystem selectel

11/03 2017

1.0.0

1.0.0.0 https://github.com/argentcrusade/flysystem-selectel

Flysystem adapter for Selectel Cloud Storage

  Sources   Download

MIT

The Requires

 

The Development Requires

flysystem selectel

11/03 2017

0.9.0

0.9.0.0 https://github.com/argentcrusade/flysystem-selectel

Flysystem adapter for Selectel Cloud Storage

  Sources   Download

MIT

The Requires

 

The Development Requires

flysystem selectel