farit-slv / selectel-flysystem-bundle
为selectel的api设计的Bundle
1.2.2
2021-04-20 13:11 UTC
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实现了Selectel适配器,用于flysystem。主要针对那些希望使用flysystem抽象来访问Selectel云存储的服务。
安装
该Bundle通过composer
安装,遵循标准结构,因此它会在symfony >= 4.2
上自动安装。
-
将存储库添加到项目的
composer.json
"repositories": [ { "type": "git", "url": "https://github.com/crtweb/selectel-flysystem-bundle" } ]
-
将Bundle包添加到项目中
$ composer require creative/selectel-flysystem-bundle
-
将Bundle包添加到项目中
# app/config/packages/creative_selectel.yaml creative_selectel: account_id: 123123 client_id: 123123_prod client_password: prod_password container: prod_container
-
将selectel适配器添加到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
配置
可用的Bundle选项
-
account_id
- Selectel账户标识符 -
client_id
- Selectel用户ID,存储访问将代表该用户进行 -
client_password
- 用户密码 -
container
- 文件将存储的容器
在本地环境中使用
请勿在本地开发或运行测试时使用生产容器。您应输入测试容器的坐标,或者使用本地文件系统的flysystem适配器。
# 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
# 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