PHPackages                             gulltour/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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. gulltour/aliyun

ActiveYii2-extension[Logging &amp; Monitoring](/categories/logging)

gulltour/aliyun
===============

Yii2 extension for Aliyun library

1.0.5(9y ago)91474GPL-3.0+HTMLPHP &gt;=5.4.0

Since Mar 17Pushed 9y ago1 watchersCompare

[ Source](https://github.com/weijiansdlx/aliyun)[ Packagist](https://packagist.org/packages/gulltour/aliyun)[ Docs](https://github.com/weijiansdlx/aliyun)[ RSS](/packages/gulltour-aliyun/feed)WikiDiscussions master Synced today

READMEChangelog (6)Dependencies (1)Versions (6)Used By (0)

\###阿里云\[OSS,DAYU,LOG,MNS, MQ\]

阿里云官方SDK的Composer封装，支持Yii2。 添加删除文件的功能，修改getUrl（只返回文件外链url，不带其他参数）。

\###安装

$ php composer.phar require gulltour/aliyun "~1.0.0"

\###OSS Yii2使用

修改config/params.php

添加：

```
'oss'=>[
         'class'=>'gulltour\aliyun\oss\AliyunOss',
         'bucket'=>'',
         'AccessKeyId' => '',
         'AccessKeySecret' => '',
         'ossServer' => '', //服务器外网地址，杭州为 http://oss-cn-hangzhou.aliyuncs.com
         'ossServerInternal' => '', //服务器内网地址，杭州为 http://oss-cn-hangzhou-internal.aliyuncs.com 如果为空则不走内网上传，内网上传会节省流量
         'imageHost' => '' //自定义资源域名 默认为 http://bucket.img-cn-hangzhou.aliyuncs.com/
     ],
```

\###使用

```
Yii::$app->oss->upload2oss($filePath, $ssoPath);

Yii::$app->oss->getImageUrl($path, $style=null);
```

\###LOG Yii2配置

```
 'log'=>[
          'class'=>'aliyun\oss\AliyunLog',
          'logstore'=>'gulltour',
          'project'=>'',
          'AccessKeyId' => '',
          'AccessKeySecret' => '',
          'endpoint'=>'oss-cn-hangzhou.aliyuncs.com',
       ],
```

\###阿里大于 Yii2配置

```
 'dayu'=>[
             'class'=>'gulltour\aliyun\aliyunDayu',
             'appKey' => '',
             'secretKey' => '',
             'signName' => '',
         ],
```

\###使用

```
Yii::$app->dayu->smsSend($mobile, $params, $template);
```

MQ Yii2使用
=========

[](#mq-yii2使用)

配置
--

[](#配置)

在组件配置中添加如下配置，

```
'notificationMq' => [
            'class' => 'gulltour\aliyun\AliyunMQ',
            'endpoint' => 'http://publictest-rest.ons.aliyun.com',
            'topic' => 'kooeu_email_sms',
            'accessKeyId' => 'iEjugjCFUSBh1IXu',
            'accessKeySecret' => 'kvNO5lvWEBLGAEOJKfTWFjVJmWmMde',
            'producerGroup' => 'PID_HYW_Message',
            'consumerGroup' => 'CID_HYW_Message',
            'messageReceiver' => function($message) {echo $message;},
            'sentCallback' => function($message, $aliMsgID) {echo $message;echo $aliMsgID;},
]
```

使用示例
----

[](#使用示例)

```
Yii::$app->notificationMq->sendMessage('1234567891');
```

\###MNS Yii2使用

YII2插件-阿里云消息队列SDK
=================

[](#yii2插件-阿里云消息队列sdk)

配置
--

[](#配置-1)

```
'mns'=>[
    'class'=>'gulltour\aliyun\aliyunMns',
    'accessId' => '',
    'accessKey' => '',
    'endpoint' => 'http://.mns.cn-beijing.aliyuncs.com/',
],
```

使用示例：
-----

[](#使用示例-1)

```
// 发送消息到队列
\Yii::$app->mns->sendMessage("QueueName", "content demo");
// 接收队列消息
$messageObject = \Yii::$app->mns->receiveMessage("QueueName");
$data = $messageObject->getMessageBody();
// 删除队列消息
\Yii::$app->mns->->deleteMessage('QueueName', $messageObject);
//publish 消息到主题
\Yii::$app->mns->publishMessage('TopicName', $data);
//订阅主题，在Yii2的 controller 中接收推送过来的数据
public function actionSubscribe()
{
	$message = \Yii::$app->request->getRawBody();
	$data = json_decode($message, true); //如果消息是JSON，PHP中需要转换成数组
｝
```

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

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

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

Total

5

Last Release

3357d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/84a23608e387141f01266a1cc68e51784c78fd5e45f23d0e7a9ac56be890c6e9?d=identicon)[weijiansdlx](/maintainers/weijiansdlx)

---

Top Contributors

[![Andrew-Wang](https://avatars.githubusercontent.com/u/780645?v=4)](https://github.com/Andrew-Wang "Andrew-Wang (2 commits)")

---

Tags

logyii2extensionwidgetossmnsdayu

### Embed Badge

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

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

###  Alternatives

[lav45/yii2-activity-logger

Tools to store user activity log for Yii2

3459.5k](/packages/lav45-yii2-activity-logger)[kriss/yii2-log-reader

Yii2 log reader

1242.1k1](/packages/kriss-yii2-log-reader)

PHPackages © 2026

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