PHPackages                             ims/common-service - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ims/common-service

ActiveN[Utility &amp; Helpers](/categories/utility)

ims/common-service
==================

信息化公共服务,tp5.1.\*

V2.0.7(5y ago)01.2kMITPHPPHP &gt;=5.6.0

Since Aug 6Pushed 5y ago2 watchersCompare

[ Source](https://github.com/1352255400/ImsCommonService)[ Packagist](https://packagist.org/packages/ims/common-service)[ RSS](/packages/ims-common-service/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (5)Dependencies (1)Versions (22)Used By (0)

欢迎使用ims-common-service公共服务
==========================

[](#欢迎使用ims-common-service公共服务)

**ims-common-service是基于thinkphp5.1的扩展**

执行命令：`composer require ims/common-service`

类库说明use ImsCommonService\\BaseModel;基础modeluse ImsCommonService\\TpCacheService;缓存封装（redis）use ImsCommonService\\CommonService;公共函数use ImsCommonService\\Code\\Code;动态图片验证码use ImsCommonService\\ExcelService;phpexcle(导入、导出)### 基础model use ImsCommonService\\BaseModel;

[](#基础model-use-imscommonservicebasemodel)

> 该类封装了对model的操作，实现查询自动缓存，变化后自动清除缓存。

基本用法：

```

```

```
.env配置说明
;数据库配置（开发环境）
DB_HOST = '127.0.0.1';
DB_USER = 'root';
DB_PWD = '';
DB_DATABASE = 'xinxinst';
DB_PORT = 3306;
DB_PREFIX = '';表前缀

```

---

### 缓存封装（redis） use ImsCommonService\\TpCacheService;

[](#缓存封装redis-use-imscommonservicetpcacheservice)

> 对redis的封装

基本用法：

```

```

```
.env配置说明
;缓存配置（开发环境）
REDIS_HOST = '127.0.0.1';
REDIS_PWD = '';
REDIS_PORT = 6379;
REDIS_SELECT = 1;
REDIS_PREFIX = 'demo:';

```

---

### 公共函数 use ImsCommonService\\CommonService;

[](#公共函数-use-imscommonservicecommonservice)

> 公共服务的封装

基本用法：

```

```

---

### 动态图片验证码 use ImsCommonService\\Code\\Code;

[](#动态图片验证码-use-imscommonservicecodecode)

> 动态图片验证码封装

基本用法：

```

```

---

### PHPExcel use ImsCommonService\\ExcelService;

[](#phpexcel-use-imscommonserviceexcelservice)

> PHPExcel 导入、导出

基本用法：

```
composer require ims/common-service 公共新增了phpExcel（导入和导出）
use ImsCommonService\ExcelService;
$excle = new  ExcelService();

导入：
$file = $_FILES['upfile'];//上传方式
$file = 'file/demo.xlsx';//文件方式
$data = $excle->import($file);

导出：（多个sheet）
//导出Excel
$data = [];
$data [] = [
	'name' => '测试1',//sheet名称
	'title' => ['标题1', '标题2', '标题3'], //表头
	'data' => [['a1', 'b1', 'c1'], ['aa1', 'bb1', 'cc1']] ,//内容
	'color' => 'FFCC0001',//字体颜色
	'color_row' => [['row' => 1, 'col_num' => 1], ['row' => 3, 'col_num' => 2]] //row第几行，col_num列数
];
$data [] = [
	'name' => '测试2',
	'title' => ['标题11', '标题22', '标题33'],
	'data' => [['a2', 'b2', 'c2'], ['aa2', 'bb2', 'cc2']],
];
//1.文件名，2.文件内容，3.保存地址（不填直接下载）
$re = $excle->export('demo', $data , 'file/');

```

---

```
.env配置说明（完整）
;当前环境描述
APP_ENV = 'dev';

;调试开关
APP_DEBUG = true;

;数据库配置（开发环境）
DB_HOST = '127.0.0.1';
DB_USER = 'root';
DB_PWD = 'root';
DB_DATABASE = 'demo';
DB_PORT = 3306;
;表前缀
DB_PREFIX = 'demo_';

;缓存配置（开发环境）
REDIS_HOST = '127.0.0.1';
REDIS_PWD = '';
REDIS_PORT = 6379;
;redis库
REDIS_SELECT = 11;
;缓存前缀（：可以分层）
REDIS_PREFIX = 'demo:';

;钉钉配置(开发工作台)
;应用id
DING_AGENT_ID = '';
DING_CORP_ID = '';
DING_CORP_SECRET = '';

;公共公共服务地址
COMMON_SERVICE_DOMAIN = 'http://common-service/';
;授權地址
PLATFORM_SERVICE_DOMAIN = 'https://d-imsapi.xinchao.com/platform/api/';

```

### End

[](#end)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 67.4% 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 ~18 days

Recently: every ~31 days

Total

21

Last Release

2104d ago

Major Versions

V1.0.13 → V2.0.02019-10-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/22653b0e739e398a39d6807aadc5b59b6d7a9391020b27005558c4c68cc7c041?d=identicon)[1352255400](/maintainers/1352255400)

---

Top Contributors

[![1352255400](https://avatars.githubusercontent.com/u/26536132?v=4)](https://github.com/1352255400 "1352255400 (29 commits)")[![XerxesSultan](https://avatars.githubusercontent.com/u/8923961?v=4)](https://github.com/XerxesSultan "XerxesSultan (14 commits)")

### Embed Badge

![Health badge](/badges/ims-common-service/health.svg)

```
[![Health](https://phpackages.com/badges/ims-common-service/health.svg)](https://phpackages.com/packages/ims-common-service)
```

###  Alternatives

[sintret/yii2-gii-adminlte

Yii2 Generator extension for Gii plugin with adminlte and base on dynagrid. upload excel to system to with log upload

209.6k2](/packages/sintret-yii2-gii-adminlte)[padosoft/php-oara

The goal of the Open Affiliate Report Aggregator (OARA) is to develop a set of PHP classes that can download affiliate reports from a number of affiliate networks, and store the data in a common format.

1811.4k1](/packages/padosoft-php-oara)

PHPackages © 2026

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