PHPackages                             enoliu/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. enoliu/flysystem-oss

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

enoliu/flysystem-oss
====================

Flysystem adapter for the AliYun OSS storage.

1.0.1(5y ago)03211MITPHP

Since Jan 21Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Enoliu/flysystem-oss)[ Packagist](https://packagist.org/packages/enoliu/flysystem-oss)[ RSS](/packages/enoliu-flysystem-oss/feed)WikiDiscussions main Synced 2d ago

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

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

[](#-flysystem-oss-)

 Flysystem adapter for the AliYun OSS storage..

Installing
----------

[](#installing)

```
$ composer require enoliu/flysystem-oss -vvv
```

Usage
-----

[](#usage)

```
use Enoliu\Flysystem\Oss\OssAdapter;
use Enoliu\Flysystem\Oss\Plugins\FileUrl;

$config = [
'accessId'     => 'LTAI77*****wHf',
'accessSecret' => 'MfSs*****DTcOzpP',
'bucket'       => 'l*****2',
'endPoint'     => 'oss-cn-beijing.aliyuncs.com',
// 'timeout'        => 3600,
// 'connectTimeout' => 10,
// 'isCName'        => false,
// 'token'          => '',
// 'useSSL'         => false
];

$flysystem = new League\Flysystem\Filesystem(new OssAdapter($config));
```

常用方法
----

[](#常用方法)

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

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

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

bool $flysystem->update('file.md', 'new contents');

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

bool $flysystem->rename('foo.md', 'bar.md');

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

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

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

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

array $flysystem->listContents();

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

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

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

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

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

插件扩展
----

[](#插件扩展)

```
use Enoliu\Flysystem\Oss\Plugins\FileUrl;

// 获取 oss 资源访问链接
$flysystem->addPlugin(new FileUrl());

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

高级用法
----

[](#高级用法)

```
// 获取前端直传签名配置
$config = [
    'dir'      => 'upload/tmp',
    'expire'   => 60 * 60,
    'callback' => 'http://www.baidu.com',
    'maxSize'  => 10 * 1024 * 1024
];
array $flysystem->getAdapter()->directUpload($config);
```

Contributing
------------

[](#contributing)

You can contribute in one of three ways:

1. File bug reports using the [issue tracker](https://github.com/enoliu/flysystem-oss/issues).
2. Answer questions or fix bugs on the [issue tracker](https://github.com/enoliu/flysystem-oss/issues).
3. Contribute new features or update the wiki.

*The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.*

License
-------

[](#license)

MIT

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity54

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 ~1 days

Total

2

Last Release

1937d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/95390f946efd93603b9f40162ef504684198c99b55fdd175ab47c8f48844b02b?d=identicon)[Enoliu](/maintainers/Enoliu)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M790](/packages/league-flysystem-aws-s3-v3)[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.2k3.3M74](/packages/unisharp-laravel-filemanager)[league/flysystem-sftp-v3

SFTP filesystem adapter for Flysystem.

6129.6M91](/packages/league-flysystem-sftp-v3)[iidestiny/flysystem-oss

Flysystem adapter for the Oss storage.

95607.5k26](/packages/iidestiny-flysystem-oss)[yii2-starter-kit/yii2-file-kit

Yii2 file upload and storage kit

151216.8k6](/packages/yii2-starter-kit-yii2-file-kit)[xxtime/flysystem-aliyun-oss

AliYun OSS adapter for flysystem. Support PHP8. aliyuncs/oss-sdk-php ~2.6

51505.3k28](/packages/xxtime-flysystem-aliyun-oss)

PHPackages © 2026

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