farit-slv / selectel-flysystem-bundle
Bundle for selectel's api
Installs: 122
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 2
Type:symfony-bundle
Requires
- php: >=7.3.0
- guzzlehttp/guzzle: ^6.3||^7.0
- league/flysystem: ^1.0
- symfony/config: ^4.2||^5.0
- symfony/dependency-injection: ^4.2||^5.0
- symfony/http-kernel: ^4.2||^5.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.13
- fzaninotto/faker: ^1.7
- phpunit/phpunit: ^9.1
- sebastian/phpcpd: ^5.0
- symfony/phpunit-bridge: ^4.0
- symfony/yaml: ^4.0
- vimeo/psalm: ^3.0
README
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
-
Add the repository to project
composer.json
:"repositories": [ { "type": "git", "url": "https://github.com/crtweb/selectel-flysystem-bundle" } ]
-
Add the bundle package to the project:
$ composer require creative/selectel-flysystem-bundle
-
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
-
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