Giter VIP home page Giter VIP logo

selectel-flysystem-bundle's Introduction

Bundle that implements Selectel adapter for flysystem

Bundle implements Selectel adapter for flysystem. Designed primarily for those services that want to use the flysystem abstraction to access Selectel cloud storage.

Installation

The bundle is installed with composer and follows the standard structure, so it is installed automatically on symfony >= 4.2

  1. Add the repository to project composer.json:

    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/crtweb/selectel-flysystem-bundle"
        }
    ]
  2. Add the bundle package to the project:

    $ composer require creative/selectel-flysystem-bundle
  3. Add the bundle package to the project:

    # app/config/packages/creative_selectel.yaml
    creative_selectel:
        account_id: 123123
        client_id: 123123_prod
        client_password: prod_password
        container: prod_container
  4. Add selectel adapter to flysystem:

    # app/config/packages/oneup_flysystem.yaml
    services:
        League\Flysystem\FilesystemInterface:
            alias: League\Flysystem\Filesystem
    
    oneup_flysystem:
        adapters:
            default_adapter:
                local:
                    directory: '%kernel.cache_dir%/flysystem'
            selectel.flysystem_adapter:
                custom:
                    service: creative_selectel.adapter.adapter
        filesystems:
            default_filesystem:
                adapter: selectel.flysystem_adapter
                alias: League\Flysystem\Filesystem

Configuration

Available bundle options:

  • account_id - Selectel account identifier

  • client_id - Selectel user ID, on whose behalf the storage will be accessed

  • client_password - user password

  • container - the container in which the files will be stored

Use in a local environment

Never use the production container for local development or for running tests. You should either enter the coordinates of the test container:

# app/config/packages/dev/creative_selectel.yaml для локальной разработки
# app/config/packages/test/creative_selectel.yaml для тестов
creative_selectel:
    account_id: 123123
    client_id: 123123_test
    client_password: test_password
    container: test_container

Or use the flysystem adapter for the local filesystem:

# app/config/packages/dev/oneup_flysystem.yaml для локальной разработки
# app/config/packages/test/oneup_flysystem.yaml для тестов
services:
    League\Flysystem\FilesystemInterface:
        alias: League\Flysystem\Filesystem

oneup_flysystem:
    adapters:
        default_adapter:
            local:
                directory: '%kernel.cache_dir%/flysystem'
    filesystems:
        default_filesystem:
            adapter: default_adapter
            alias: League\Flysystem\Filesystem

selectel-flysystem-bundle's People

Contributors

andrew72ru avatar anvein avatar evilkeeper avatar faritslv avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

faritslv

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.