dakword/yandexdisk-storage
最新稳定版本:1.3.0
Composer 安装命令:
composer require dakword/yandexdisk-storage
包简介
YandexDisk Storage filesystem for Flysystem
README 文档
README
Installation
composer require dakword/yandexdisk-storage
Usage
$config = [ // option => default 'visibility' => 'private', // 'public', 'private' 'retain_visibility' => true, 'checksum_algo' => 'md5', // 'md5', 'sha256' ]; $client = new Arhitector\Yandex\Disk('oauth-token'); $adapter = new YandexDiskStorageAdapter($client, $prefix = '/', $config); $yandexDiskStorage = new League\Flysystem\Filesystem($adapter); try { $content = $yandexDiskStorage->read('images/file.jpg'); } catch (FilesystemException | UnableToReadFile $exception) { // handle the error }
Laravel Integration
Dakword\YandexDiskStorage\YandexDiskServiceProvider::class // config/filesystems.php 'yandex' => [ 'driver' => 'yandex-disk', 'token' => env('YANDEX_DISK_OAUTH_TOKEN'), 'prefix' => env('YANDEX_DISK_BASE_PATH', '/'), // option => default 'visibility' => 'private', // 'public', 'private' 'retain_visibility' => true, 'checksum_algo' => 'md5', // 'md5', 'sha256' ], // Usage // -------------------------------------- $yandexDiskStorage = Storage::disk('yandex'); // create a file $yandexDiskStorage->put('images/file.jpg', $imageContents); // check exists $exists = $yandexDiskStorage->exists('images/file.jpg');
Links
统计信息
- 总下载量: 23
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-08-22