PHPackages                             xutl/yii2-aliyun - 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. [API Development](/categories/api)
4. /
5. xutl/yii2-aliyun

ActiveYii2-extension[API Development](/categories/api)

xutl/yii2-aliyun
================

The aliyun extension for the Yii framework

2.0.1.1(8y ago)44.4k1MITPHPPHP &gt;=5.4.0

Since May 22Pushed 8y ago1 watchersCompare

[ Source](https://github.com/xutl/yii2-aliyun)[ Packagist](https://packagist.org/packages/xutl/yii2-aliyun)[ RSS](/packages/xutl-yii2-aliyun/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (10)Dependencies (3)Versions (21)Used By (1)

Aliyun Extension for Yii 2
==========================

[](#aliyun-extension-for-yii-2)

适用于 Yii2 的 Aliyun SDK。使用了DI实现的，可自行继承扩展。

[![Latest Stable Version](https://camo.githubusercontent.com/777f8ac31869dbd2b7b0ac154b019129442bb5921013380224a8747ecff34e3b/68747470733a2f2f706f7365722e707567782e6f72672f7875746c2f796969322d616c6979756e2f762f737461626c652e706e67)](https://packagist.org/packages/xutl/yii2-aliyun)[![Total Downloads](https://camo.githubusercontent.com/562d4619a0018436d22899dac85aad960119710ea2559b2e8349c2b689864401/68747470733a2f2f706f7365722e707567782e6f72672f7875746c2f796969322d616c6979756e2f646f776e6c6f6164732e706e67)](https://packagist.org/packages/xutl/yii2-aliyun)[![License](https://camo.githubusercontent.com/756aab825bea4709a0e30cdd44b834c1794b7f8f8280d4181629e9fd21ed249a/68747470733a2f2f706f7365722e707567782e6f72672f7875746c2f796969322d616c6979756e2f6c6963656e73652e737667)](https://packagist.org/packages/xutl/yii2-aliyun)

支持的接口和服务：

- CDN
- 实人认证
- 云相册
- 云推送
- 邮件推送
- DNS
- 域名
- 内容安全
- HTTPDNS
- 移动安全
- 直播
- 媒体转码
- 负载均衡
- 短信
- 视频点播
- VPC

Installation
------------

[](#installation)

Next steps will guide you through the process of installing using [composer](http://getcomposer.org/download/). Installation is a quick and easy three-step process.

### Step 1: Install component via composer

[](#step-1-install-component-via-composer)

Either run

```
composer require --prefer-dist xutl/yii2-aliyun

```

or add

```
"xutl/yii2-aliyun": "~2.0.0"
```

to the `require` section of your composer.json.

### Step 2: Configuring your application

[](#step-2-configuring-your-application)

Add following lines to your main configuration file:

```
'components' => [
    'aliyun' => [
        'class' => 'xutl\aliyun\Aliyun', //这个类其实就是 继承了  `\yii\di\ServiceLocator` 类。 
        'accessId' => '123456',
        'accessKey' => '654321',
        'params'=> [//这里是非扩展的配置参数，如队列任务等
            'CloudPush.appKey' => 123456789
        ],
        'components' => [
             //各子组件配置，如果无需配置不写即可。也可动态注入配置。
             //如果子组件使用独立的 `accessId` 和 `accessKey` 那么在子组件中单独配置即可，如果没有配置默认使用父  `accessId` 和 `accessKey` 。
             //如果你自己扩展了其他的子组件，这里定义下新的组件配置即可，配置方式，数组接口和 YII 原生组件一致！
            //etc
        ]
    ],
],
```

### Use

[](#use)

使用方式非常简单

```
$aliyun = Yii::$app->aliyun;

$cloudPush = $aliyun->getCloudPush();

// 查看文档 https://help.aliyun.com/knowledge_detail/48085.html 请求参数中的 `Action` 省略，其他的照着写上就发包了。
// 实现原理是 首先 Aliyun 类使用 DI 技术 将子组件注册进来，在第一次使用时，会自动初始化，接着使用PHP的魔术方法请求对应的接口，方法名称即 `Action` 参数首字母小写即可。

$res = $cloud->pushMessageToAndroid([
    'AppKey'=>'123456',
    'Target' => 'ALL',
    'TargetValue' => 'ALL',
    'Title' => 'Hello',
    'Body' => 'Hello World!',
]);

var_dump($res->isOk);
print_r($res->data);

//或者使用队列处理

Yii::$app->queue->push(new \xutl\aliyun\jobs\PushNoticeToMobile([
    //etc
]));

//其他接口类似调用方式

//如果扩展 暂不支持的接口，直接继承 `\xutl\aliyun\BaseClient` 和 `\xutl\aliyun\BaseAcsClient` 基类即可自带 认证。你只需扩展方法即可。
// 然后使用YII 自带的组件机制，参见上面的安装配置，把你自定义的接口注入进来即可。
```

说明
--

[](#说明)

如果你对这个接口感兴趣，可以直接提交PR来合并更新。工作日工作时间，基本能实时响应合并。

License
-------

[](#license)

This is released under the MIT License. See the bundled [LICENSE.md](LICENSE.md)for details.

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity67

Established project with proven stability

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

Total

20

Last Release

3080d ago

Major Versions

1.1.3 → 2.0.02017-12-15

### Community

Maintainers

![](https://www.gravatar.com/avatar/87b658aa9d49e0c80cfc609fa2b9dc6d615672b1d895f421f751945a0e394087?d=identicon)[larvacent](/maintainers/larvacent)

---

Top Contributors

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

---

Tags

aliyunphpphp-libraryxutlyii2-extensionapialiyunyii

### Embed Badge

![Health badge](/badges/xutl-yii2-aliyun/health.svg)

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

###  Alternatives

[sonko-dmitry/yii2-telegram-bot-api

Telegram bot api component for Yii2

2032.4k1](/packages/sonko-dmitry-yii2-telegram-bot-api)[skeeks/yii2-google-api

Component for work with google api based on google/apiclient

1143.6k1](/packages/skeeks-yii2-google-api)

PHPackages © 2026

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