PHPackages                             hillstill/sooh - 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. hillstill/sooh

ActiveLibrary

hillstill/sooh
==============

1.6(10y ago)0351MITPHPPHP &gt;=5.3.0

Since May 3Pushed 10y ago1 watchersCompare

[ Source](https://github.com/hillstill/sooh)[ Packagist](https://packagist.org/packages/hillstill/sooh)[ RSS](/packages/hillstill-sooh/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)DependenciesVersions (8)Used By (0)

Sooh: stone of other hill
=========================

[](#sooh-stone-of--other-hill)

搞这个库的初衷是没找到用的舒服的数据库访问层。我想用的库有以下几个特点:

1）便于编写 2）便于调试

看过pdo,看过Statements的写法，都觉得欠了点，于是自己捣鼓出下面的写法：

```
//获取记录总数
$recordCount = $db->getRecordCount('tb_user');
//tb_login_log中取出20121230登入的用户，然后到tb_user表查出uid和phone的对应数组
//phone = array(123123123=>12314123,.....)
$phone = $db->getPair('tb_user','uid','phone',array('uid'=>$db->getCol('tb_login_log','uid',array('ymdLogin'=>'20121230'))));

try{
	//尝试添加，捕获丢出的异常，如果是键重复，改为update, 如果不是键重复，打印日志
	\Sooh\DB\Broker::errorMarkSkip(\Sooh\DB\Error::duplicateKey);
	$db->addRecord('tb_user',array('uid'=>'123123123','phone'=>'12314123'));
}catch(\ErrorException){
	if(\Sooh\DB\Broker::errorIs(\Sooh\DB\Error::duplicateKey)){
		$db->updRecords('tb_user',array('phone'=>'12314123'),array('uid'=>'123123123'));
	}else{
		error_log(Sooh\DB\Broker::lastCmd());
		\\打印日志：[db_host_portIfSetted]insert into tb_user set uid='123123123','phone'=>'12314123'
	}
}
```

加上no-sql大行其道的今天，我又追加了针对此类情况的封装类，根据设置： 1）数据可以分拆存储到不同物理服务器、库、表； 2）可以优先读取cache库，更新的时候才落地；

\##Base\\\* basic classes, such as Ini,Time, Tools ....

基础类, 诸如 ini ( 配置类 ), Time (时间类), Tools(工具类).... 都是些小东西。 [see details](mds/base.md "see details")

\##DB\\\* classes based on database (abstract layer and classes for special cases)， include kvobj (support table-split and cache) and other classes for special cases.

数据库类, 数据库访问封装，KVOBJ类（内置支持分表分库，缓存表）以及一些特定应用场景的封装类 [see details](mds/db.md "see details")

后续目标： 目前支持mysql,mssql(微软提供的库),看过mongo,redis,oracle的文档，应该可以支持，但没写出对应封装类。

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 97% 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 ~27 days

Total

7

Last Release

3869d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3f8830c438d72282a1c9bf121a472baa6a1e78364149873cab9525b2501f102e?d=identicon)[hillstill](/maintainers/hillstill)

---

Top Contributors

[![hillstill](https://avatars.githubusercontent.com/u/11157966?v=4)](https://github.com/hillstill "hillstill (64 commits)")[![waynewn](https://avatars.githubusercontent.com/u/9529021?v=4)](https://github.com/waynewn "waynewn (2 commits)")

### Embed Badge

![Health badge](/badges/hillstill-sooh/health.svg)

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

PHPackages © 2026

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