PHPackages                             luminescent/aliyun-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. luminescent/aliyun-oss

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

luminescent/aliyun-oss
======================

阿里云 OSS 官方 SDK 的 Composer 封装

v2.0.0(2y ago)011MITPHPPHP &gt;=5.4.0

Since Jun 19Pushed 2y ago1 watchersCompare

[ Source](https://github.com/xiaojiang123456/aliyun-oss)[ Packagist](https://packagist.org/packages/luminescent/aliyun-oss)[ Docs](https://github.com/johnlui/AliyunOSS)[ RSS](/packages/luminescent-aliyun-oss/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

AliyunOSS
---------

[](#aliyunoss)

```
    ___     __    _                                    ____    _____   _____
   /   |   / /   (_)   __  __  __  __   ____          / __ \  / ___/  / ___/
  / /| |  / /   / /   / / / / / / / /  / __ \        / / / /  \__ \   \__ \
 / ___ | / /   / /   / /_/ / / /_/ /  / / / /       / /_/ /  ___/ /  ___/ /
/_/  |_|/_/   /_/    \__, /  \__,_/  /_/ /_/        \____/  /____/  /____/
                    /____/

```

AliyunOSS 是阿里云 OSS 官方 SDK 的 Composer 封装，支持任何 PHP 项目

更新记录
----

[](#更新记录)

- 2023-06-29 `Release v1.0.0`

安装
--

[](#安装)

安装有两种方式：

### ① 直接编辑配置文件

[](#-直接编辑配置文件)

将以下内容增加到 composer.json：

```
require: {
    "luminescent/aliyun-oss": "~2.0"
}
```

然后运行 `composer update`。

### ② 执行命令安装

[](#-执行命令安装)

运行命令：

```
composer require luminescent/aliyun-oss
```

使用（以 Laravel 为例）
----------------

[](#使用以-laravel-为例)

### 构建 Service 文件

[](#构建-service-文件)

新建 `app/services/OSS.php`，内容可参考：[OSS.php](https://github.com/johnlui/AliyunOSS/blob/master/example/OSS.php)，然后修改配置：

```
... ...

  private $city = '青岛';

  // 经典网络 or VPC
  private $networkType = '经典网络';

  private $AccessKeyId = '';
  private $AccessKeySecret = '';

... ...
```

### 放入自动加载

[](#放入自动加载)

#### 遵循 psr-0 的项目（如Laravel 4、CodeIgniter、TinyLara）中：

[](#遵循-psr-0-的项目如laravel-4codeignitertinylara中)

在 `composer.json` 中 `autoload -> classmap` 处增加配置：

```
"autoload": {
    "classmap": [
      "app/services"
    ]
  }
```

然后运行 `composer dump-autoload`。

#### 遵循 psr-4 的项目（如 Laravel 5、Symfony）中：

[](#遵循-psr-4-的项目如-laravel-5symfony中)

无需配置，保证目录 `App/Services` 和命名空间 `namespace App\Services;` 一致即可自动加载。

### 使用

[](#使用)

```
use App\Services\OSS;

// 在外网上传一个文件并指定 options 如：Content-Type 类型
// 更多 options 见：https://github.com/johnlui/AliyunOSS/blob/master/src/oss/src/Aliyun/OSS/OSSClient.php#L142-L148
OSS::publicUpload('bucket', '目标 object 名', '本地文件路径', [
    'ContentType' => 'application/pdf',
    ... ...
]);
```

更多用法等待着你去[发现](https://github.com/johnlui/AliyunOSS/blob/master/example/OSS.php)。

反馈
--

[](#反馈)

有问题请到  下面留言。

License
-------

[](#license)

除 “版权所有（C）阿里云计算有限公司” 的代码文件外，遵循 [MIT license](http://opensource.org/licenses/MIT) 开源。

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

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

Total

2

Last Release

1059d ago

Major Versions

v1.0.0 → v2.0.02023-06-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/2eed65fbd0c8f1a857d1da7ad8bc9911b949648d3a577cbd66c13bc5f4523fb4?d=identicon)[ieddcn](/maintainers/ieddcn)

---

Tags

aliyunossAliyunOSS

### Embed Badge

![Health badge](/badges/luminescent-aliyun-oss/health.svg)

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

###  Alternatives

[johnlui/aliyun-oss

阿里云 OSS 官方 SDK 的 Composer 封装，支持任何 PHP 项目，包括 Laravel、Symfony、TinyLara 等等。

501178.3k6](/packages/johnlui-aliyun-oss)[jacobcyl/ali-oss-storage

aliyun oss filesystem storage for laravel 5+

523566.2k7](/packages/jacobcyl-ali-oss-storage)[alphasnow/aliyun-oss-laravel

alibaba cloud object storage service for laravel

182240.7k2](/packages/alphasnow-aliyun-oss-laravel)[johnlui/aliyun-oss-laravel7

阿里云 OSS 官方 SDK 的 Composer 封装，支持任何 PHP 项目，包括 Laravel、Symfony、TinyLara 等等。

347.8k1](/packages/johnlui-aliyun-oss-laravel7)[alphasnow/aliyun-oss-flysystem

Flysystem adapter for the Aliyun storage

14249.2k4](/packages/alphasnow-aliyun-oss-flysystem)[summergeorge/ali-oss-storage

aliyun oss filesystem storage for laravel 5+

3915.5k](/packages/summergeorge-ali-oss-storage)

PHPackages © 2026

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