PHPackages                             nomedia/yii2-easemob-sdk-2020 - 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. nomedia/yii2-easemob-sdk-2020

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

nomedia/yii2-easemob-sdk-2020
=============================

环信 easemob API for Yii 2.0

v1.1.6(6y ago)029[1 issues](https://github.com/nomedia/yii2-easemob-sdk-2020/issues)MITPHPPHP &gt;=5.4.0

Since Mar 24Pushed 6y ago1 watchersCompare

[ Source](https://github.com/nomedia/yii2-easemob-sdk-2020)[ Packagist](https://packagist.org/packages/nomedia/yii2-easemob-sdk-2020)[ Docs](https://github.com/nomedia/yii2-easemob-sdk)[ RSS](/packages/nomedia-yii2-easemob-sdk-2020/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (3)Versions (8)Used By (0)

yii2-easemob-sdk
================

[](#yii2-easemob-sdk)

基于Yii2实现的环信API SDK（目前开发中）

环境条件
----

[](#环境条件)

- > = PHP 5.4
- > = Yii 2.0
- > = GuzzleHttp 5.0

安装
--

[](#安装)

添加下列代码在`composer.json`文件中并执行`composer update --no-dev`操作

```
{
    "require": {
    "nomedia/yii2-easemob-sdk-2020": "^1.1",
    }
}
```

设置方法
----

[](#设置方法)

```
// 全局使用
// 在config/main.php配置文件中定义component配置信息
'components' => [
  .....
  'easemob' => [
    'class' => 'nomedia\Easemob\Easemob',
    'orgName' => '企业ID',
    'appName' => '应用名称',
    'clientId' => 'Client Id',
    'clientSecret' => 'Client Secret',
  ]
  ....
]
// 代码中调用
$result = Yii::$app->easemob->getUser('username');
....
```

```
// 局部调用
$easemob = Yii::createObject([
    'class' => 'nomedia\Easemob\Easemob',
    'orgName' => '企业ID',
    'appName' => '应用名称',
    'clientId' => 'Client Id',
    'clientSecret' => 'Client Secret',
]);
$result = $easemob->getUser('username');
....
```

使用示例
----

[](#使用示例)

创建单个用户

```
$userInfo = Yii::$app->easemob->createUser('username', 'password', 'nickname');
```

获取单个用户

```
$userInfo = Yii::$app->easemob->getUser('username');
```

获取用户Access Token

```
$tokenInfo = Yii::$app->easemob->getUserToken('username', 'password');
```

添加好友

```
$friendInfo = Yii::$app->easemob->addFriend('username1', 'username2');
```

导出聊天记录

```
$data = Yii::$app->easemob->exportChatMessages();
```

发送透传消息

```
$data = Yii::$app->easemob->sendCmd('users', ['user1', 'users2'], 'action1', ['key1' => 'value1'], 'admin');
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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

Total

7

Last Release

2223d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5ab9de17e80d1cd7d0a7e8ce8912898a5ed5885f3a9ed1ef7617202606b39e12?d=identicon)[ettgf@qq.com](/maintainers/ettgf@qq.com)

---

Top Contributors

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

---

Tags

sdkyii2imeasemob

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nomedia-yii2-easemob-sdk-2020/health.svg)

```
[![Health](https://phpackages.com/badges/nomedia-yii2-easemob-sdk-2020/health.svg)](https://phpackages.com/packages/nomedia-yii2-easemob-sdk-2020)
```

###  Alternatives

[mailchimp/transactional

458.9M16](/packages/mailchimp-transactional)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)[hardcastle/xrpl_php

PHP SDK / Client for the XRP Ledger

129.7k5](/packages/hardcastle-xrpl-php)

PHPackages © 2026

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