PHPackages                             apixx/flysystem-oss - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. apixx/flysystem-oss

ActiveLibrary[File &amp; Storage](/categories/file-storage)

apixx/flysystem-oss
===================

Flysystem adapter for the Oss storage.

1.0.1(3y ago)1841MITPHPPHP ^8.0.2

Since Nov 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/LeePillar/flysystem-oss)[ Packagist](https://packagist.org/packages/apixx/flysystem-oss)[ RSS](/packages/apixx-flysystem-oss/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (3)Used By (1)

flysystem-oss
==============

[](#flysystem-oss-)

💾 Flysystem adapter for the oss storage.

扩展包要求
-----

[](#扩展包要求)

- PHP &gt;= 8.0.2

安装命令
----

[](#安装命令)

```
$ composer require "apixx/flysystem-oss"
```

使用
--

[](#使用)

```
use League\Flysystem\Filesystem;
use Iidestiny\Flysystem\Oss\OssAdapter;
use Iidestiny\Flysystem\Oss\Plugins\FileUrl;

$prefix = ''; // 前缀，非必填
$accessKeyId = 'xxxxxx';
$accessKeySecret = 'xxxxxx';
$endpoint= 'oss.iidestiny.com'; // ssl：https://iidestiny.com
$bucket = 'bucket';
$isCName = true; // 如果 isCname 为 false，endpoint 应配置 oss 提供的域名如：`oss-cn-beijing.aliyuncs.com`，cname 或 cdn 请自行到阿里 oss 后台配置并绑定 bucket

$adapter = new OssAdapter($accessKeyId, $accessKeySecret, $endpoint, $bucket, $isCName, $prefix);

// $adapter->setCdnUrl('https://cdn.iidestiny.com'); // 设置cdn url

$flysystem = new Filesystem($adapter);
```

常用方法
----

[](#常用方法)

```
void $flysystem->write('file.md', 'contents');

void $flysystem->write('file.md', 'http://httpbin.org/robots.txt', ['options' => ['xxxxx' => 'application/redirect302']]);

void $flysystem->writeStream('file.md', fopen('path/to/your/local/file.jpg', 'r'));

void $flysystem->move('foo.md', 'bar.md');

void $flysystem->copy('foo.md', 'foo2.md');

void $flysystem->delete('file.md');

void $flysystem->deleteDirectory('file.md');

bool $flysystem->fileExists('file.md');

 $flysystem->read('file.md');

array $flysystem->listContents();

array $flysystem->getMetadata('file.md');

int $flysystem->fileSize('file.md');

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

string $flysystem->mimeType('file.md');

int $flysystem->lastModified('file.md');
```

插件扩展
----

[](#插件扩展)

从 `filesystem v2` 版本开始插件功能被移除，所以要使用这些功能需要引用创建 `Adapter` 适配器，以下所有案例都是以前插件功能

```
$adapter = new OssAdapter($accessKeyId, $accessKeySecret, $endpoint, $bucket, $isCName, $prefix);

// 获取 oss 资源访问链接
string $adapter->getUrl('file.md');

// url 访问有效期 & 图片处理「$timeout 为多少秒过期」
// 默认GET
string $adapter->getTemporaryUrl('file.md', $timeout, ['x-oss-process' => 'image/circle,r_100']);
// PUT
string $adapter->getTemporaryUrl('file.md', $timeout, ['x-oss-process' => 'image/circle,r_100'],'PUT');

// 多个bucket切换
$adapter->bucket('test')->has('file.md');
```

获取官方完整 OSS 处理能力
---------------

[](#获取官方完整-oss-处理能力)

阿里官方 SDK 可能处理了更多的事情，如果你想获取完整的功能可通过此插件获取， 然后你将拥有完整的 oss 处理能力

```
$kernel = $adapter->ossKernel();

// 例如：防盗链功能
$refererConfig = new RefererConfig();
// 设置允许空Referer。
$refererConfig->setAllowEmptyReferer(true);
// 添加Referer白名单。Referer参数支持通配符星号（*）和问号（？）。
$refererConfig->addReferer("www.aliiyun.com");
$refererConfig->addReferer("www.aliiyuncs.com");

$kernel->putBucketReferer($bucket, $refererConfig);
```

> 更多功能请查看官方 SDK 手册：[https://help.aliyun.com/document\_detail/32100.html?spm=a2c4g.11186623.6.1055.66b64a49hkcTHv](https://help.aliyun.com/document_detail/32100.html?spm=a2c4g.11186623.6.1055.66b64a49hkcTHv)

参考
--

[](#参考)

- [overtrue/flysystem-qiniu](https://github.com/overtrue/flysystem-qiniu)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~125 days

Total

2

Last Release

1154d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c4f5905f4d535af692d2e80dfbdf9ff3731861b68afb547c8b811b21a2e57875?d=identicon)[LeePillar](/maintainers/LeePillar)

---

Top Contributors

[![LeePillar](https://avatars.githubusercontent.com/u/101307498?v=4)](https://github.com/LeePillar "LeePillar (4 commits)")

---

Tags

laravelossalioss

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/apixx-flysystem-oss/health.svg)

```
[![Health](https://phpackages.com/badges/apixx-flysystem-oss/health.svg)](https://phpackages.com/packages/apixx-flysystem-oss)
```

###  Alternatives

[iidestiny/flysystem-oss

Flysystem adapter for the Oss storage.

95607.5k26](/packages/iidestiny-flysystem-oss)[jacobcyl/ali-oss-storage

aliyun oss filesystem storage for laravel 5+

523566.2k7](/packages/jacobcyl-ali-oss-storage)[yangyifan/upload

上传 SDK for Laravel

12422.6k3](/packages/yangyifan-upload)[luoyy/ali-oss-storage

aliyun oss filesystem storage for laravel 9+

1529.9k1](/packages/luoyy-ali-oss-storage)[aobozhang/aliyun-oss-adapter

Use Aliyun oss as Storage for Laravel 5.0+

141.0k](/packages/aobozhang-aliyun-oss-adapter)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
