2017 © Pedro Peláez
 

library yii2-filesystem

Yii2 integration for league/flysystem

image

wearesho-team/yii2-filesystem

Yii2 integration for league/flysystem

  • Tuesday, July 3, 2018
  • by Horat1us
  • Repository
  • 2 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 12 Versions
  • 0 % Grown

The README.md

Yii2 Filesystem

Test & Lint Latest Stable Version Total Downloads codecov License, (*1)

Integration of league/flysystem for Yii2., (*2)

It is configured by environment variables by default. Available integration out-of-box: - FTP - should be used in deprecated systems - Local - should be used for development - S3 - should be used in production, (*3)

Configuring

By-default configuring available using environment variables. To choose which integration to use you need to configure FILESYSTEM_ADAPTER variable. Available values: local, ftp, s3. (or another, if you use custom bootstrap configuration), (*4)

Configuring S3 adapter

Variable Required Default Description
S3_ENDPOINT yes endpoint url (with http/https)
S3_KEY yes public key
S3_SECRET yes secret key
S3_VERSION no latest
S3_REGION yes Example: eu-central-1
S3_BUCKET yes Example: yourcompany
S3_PREFIX no empty string path prefix
S3_BASE_URL no base url will be used to generate URL to files

Configuring Local adapter

Variable Required Default Description
FILESYSTEM_LOCAL_SAVE_PATH yes path to save file on local machine
FILESYSTEM_LOCAL_BASE_URL no base url will be used to generate URL to files

Configuring Ftp adapter

Variable Required Default Description
FTP_HOST yes
FTP_USER yes
FTP_PASS no null password for FTP user
FTP_PORT no 21
FTP_PATH no empty string prefix for save path
FTP_BASE_URL no base url will be used to generate URL to files

Configuring Replica adapter

This adapter purpose of mirroring files on few adapters (any AdapterInterface implementation), (*5)

<?php

use Wearesho\Yii\Filesystem;

$adapter = new Filesystem\Replica\Adapter([
    'master' => [
        'class' => Filesystem\S3\Adapter::class,
    ],
    'slaves' => [
        // so much slaves
        [
            'class' => Filesystem\Ftp\Adapter::class,
        ],
    ],
]);

Usage

Bootstrap

To start use this package out-of-box you need to append Bootstrap into your Yii2 application., (*6)

<?php

// common/config/main.php or another configuration file

use Wearesho\Yii\Filesystem;

return [
    'components' => [
        // ...
    ],
    'bootstrap' => [
        'class' => Filesystem\Bootstrap::class,
        'container' => true, // if you need to configure global DI container (\Yii::$container)
        'id' => 'fs', // \Yii::$app component to be configured. Filesystem will be available using \Yii::$app->fs
    ],
];

Note: for advanced usage you may customize Bootstrap adapters and config properties, (*7)

Filesystem Class

You can also use Filesystem class for yii2-way configuration:, (*8)

<?php

use Wearesho\Yii\Filesystem\Filesystem;
use Wearesho\Yii\Filesystem\AdapterInterface;

$fs = new Filesystem([
    'adapter' => [
        'class' => AdapterInterface::class, // or another implementation, if container not configured
    ],
]);

TODO

  • Tests

License

MIT, (*9)

The Versions

03/07 2018

dev-master

9999999-dev

Yii2 integration for league/flysystem

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Letnikow

03/07 2018
03/07 2018

dev-feature/replication

dev-feature/replication

Yii2 integration for league/flysystem

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Letnikow

02/07 2018

4.0.1

4.0.1.0

Yii2 integration for league/flysystem

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Letnikow

02/07 2018

dev-hotfix/container

dev-hotfix/container

Yii2 integration for league/flysystem

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Letnikow

28/06 2018

4.0.0

4.0.0.0

Yii2 integration for league/flysystem

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Letnikow

27/06 2018

3.0.0

3.0.0.0

Yii2 integration for league/flysystem

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Letnikow

05/04 2018

2.0.0

2.0.0.0

Yii2 integration for league/flysystem

  Sources   Download

proprietary

The Requires

 

by Alexander Letnikow

16/02 2018

1.0.3

1.0.3.0

Yii2 integration for league/flysystem

  Sources   Download

proprietary

The Requires

 

by Alexander Letnikow

16/02 2018

1.0.2

1.0.2.0

Yii2 integration for league/flysystem

  Sources   Download

proprietary

The Requires

 

by Alexander Letnikow

16/01 2018

1.0.1

1.0.1.0

Yii2 integration for league/flysystem

  Sources   Download

proprietary

The Requires

 

by Alexander Letnikow

22/12 2017

1.0.0

1.0.0.0

Yii2 integration for league/flysystem

  Sources   Download

proprietary

The Requires

 

by Alexander Letnikow