wispx/flysystem-upyun

Upyun 存储的 Flysystem 适配器。

资助包维护!
wisp-x

1.0 2022-03-10 03:14 UTC

This package is not auto-updated.

Last update: 2024-09-20 13:36:31 UTC


README

💾 Upyun 云存储的 Flysystem 适配器。

此包修改自 overtrue/flysystem-qiniu

要求

  • PHP >= 8.0.2

安装

$ composer require "wispx/flysystem-upyun"

使用

use League\Flysystem\Filesystem;
use WispX\Flysystem\Upyun\UpyunAdapter;

$service = 'xxxxxx';
$operator = 'xxxxxx';
$password = 'xxxxxx';
$domain = 'xxxx.test.upcdn.net'; // or with protocol: https://xxxx.test.upcdn.net

$adapter = new UpyunAdapter($service, $operator, $password, $domain);

$flysystem = new League\Flysystem\Filesystem($adapter);

API

bool $flysystem->write('file.md', 'contents');
bool $flysystem->write('file.md', 'http://httpbin.org/robots.txt');
bool $flysystem->writeStream('file.md', fopen('path/to/your/local/file.jpg', 'r'));
bool $flysystem->copy('foo.md', 'foo2.md');
bool $flysystem->delete('file.md');
bool $flysystem->has('file.md');
bool $flysystem->fileExists('file.md');
bool $flysystem->directoryExists('path/to/dir');
string|false $flysystem->read('file.md');
array $flysystem->listContents();
int $flysystem->fileSize('file.md');
string $flysystem->mimeType('file.md');

适配器扩展方法

string $adapter->getUrl('file.md');

许可证

MIT