gumphp / think-storage
The ThinkPHP6.1 Filesystem Package
v1.0.3
2023-05-26 08:06 UTC
Requires
- php: >=7.2.5
- league/flysystem: ^1.1.4
- league/flysystem-aws-s3-v3: ^1.0
- league/flysystem-cached-adapter: ^1.0
- topthink/framework: ^6.0
- topthink/think-filesystem: ^1.0
This package is auto-updated.
Last update: 2024-11-26 11:26:23 UTC
README
composer require gumphp/think-storage
配置
# config/filesystem.php return [ 'disks' => [ 's3' => [ 'type' => 'aws', 'root' => '/', 'credentials' => [ 'key' => env('S3_KEY', ''), 'secret' => env('S3_SECRET', ''), ], 'version' => env('S3_VERSION', 'latest'), 'region' => env('S3_REGION', 'us-west-2'), 'bucket' => env('S3_BUCKET', ''), ], ], ];
使用
use GumPHP\Storage\Facade\Storage; Storage::disk('s3')->put('/s3/remote/file.ext', file_get_contents('/path/yourfile.ext'));