PHPackages                             ims/tp-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/tp-service

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

ims/tp-service
==============

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

00PHP

Since Mar 25Pushed 6y ago1 watchersCompare

[ Source](https://github.com/1352255400/mt-tp-service)[ Packagist](https://packagist.org/packages/ims/tp-service)[ RSS](/packages/ims-tp-service/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

信息化公共服务
=======

[](#信息化公共服务)

基于tp5进行扩展 //完美支持tp5.1 //5.0兼容说明 /application/common.php新增env函数 use think\\Env; if (!function\_exists('env')) { function env($str = '',$end = '') { return Env::get($str,$end); } }

.env 配置：TP\_VERSION=50

基本使用：

1.配置：使用.env 可能涉及到配置： ;缓存配置（开发环境） REDIS\_HOST = '127.0.0.1'; REDIS\_PWD = ''; REDIS\_PORT = 6379; REDIS\_SELECT = 10; REDIS\_PREFIX = 'work:';

;公共服务域名地址 COMMON\_SERVICE\_DOMAIN = '';

2.使用 composer require ims/common-service

use ImsCommonService\\CommonService;

$CommonService = new CommonService(); $re= $CommonService-&gt;getUser(); p($re);die;

3.基本类库 //公共服务 use ImsCommonService\\BaseModel; //基础model（加入缓存封装） use ImsCommonService\\BaseModel; 使用： class DemoModel extends BaseModel

//基于tp缓存的封装 use ImsCommonService\\TpCacheService; 使用： $cache = new TpCacheService(); $key = 'demo';

//单key使用 //写入 $cache-&gt;set($key,time(),20); //读取 $cache-&gt;get($key); //删除 $cache-&gt;delete($key);

//缓存组使用 $keys = 'demo:'; for ($i=0; $i &lt; 10; $i++) { //写入 $cache-&gt;saveWithKey($keys, $key.$i, $i, 100); }

//删除 $cache-&gt;delWithKey($keys);

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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.

### 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 (3 commits)")

### Embed Badge

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

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

###  Alternatives

[melihovv/laravel-package-generator

A laravel package generator

14434.7k1](/packages/melihovv-laravel-package-generator)[scottjs/wp-dotenv

Helper scripts to enable WordPress to use dotenv config files, similar to Laravel 5.

1811.7k1](/packages/scottjs-wp-dotenv)[hiqdev/yii2-language

Yii2 module for language switching

1126.1k1](/packages/hiqdev-yii2-language)[zerkalica/semaphore

This library provides an api for semaphore acquire and release

1119.0k1](/packages/zerkalica-semaphore)

PHPackages © 2026

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