PHPackages                             hw/lib-php - 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. hw/lib-php

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

hw/lib-php
==========

公共类库

v1.0.4(5y ago)010PHPPHP &gt;=7.2

Since Sep 18Pushed 5y ago1 watchersCompare

[ Source](https://github.com/hewei520/lib-php)[ Packagist](https://packagist.org/packages/hw/lib-php)[ RSS](/packages/hw-lib-php/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

lib-php
=======

[](#lib-php)

The public library for xiniao

### 一、安装

[](#一安装)

#### 1.依赖

[](#1依赖)

- composer
- thinkphp5.1

#### 2.安装方法

[](#2安装方法)

```
composer require hw/lib-php:{version}

说明：{version}指定的版本号

```

### 二、目录结构

[](#二目录结构)

```
lib-php  跟目录
├─log                  日志目录
│  └─Log.php           日志类文件
│
├─src                  src目录
│  ├─Output.php        输出类文件
│  └─StatusCode.php    状态码与映射归类文件
│
├─composer.json         composer 定义文件
├─README.md             README 文件

```

### 三、使用方法

[](#三使用方法)

#### 1.日志调用方法

[](#1日志调用方法)

```
日志静态调用方法有：info、debug、error、warning、sql、log

\hw\log\Log::info($message, $context)
\hw\log\Log::debug($message, $context)
\hw\log\Log::error($message, $context)
\hw\log\Log::warning($message, $context)
\hw\log\Log::sql($message, $context)
\hw\log\Log::log($level, $message, $context)

说明：$message描述信息 $context内容 $level日志等级

```

#### 2.输出接口调用方法

[](#2输出接口调用方法)

```
输出类静态调用方法

\hw\output\Output::result($code, $data, $message)
\hw\output\Output::success($data)
\hw\output\Output::error($code, $data, $message)

说明：$code状态码 $data数据 $message状态信息

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

Total

5

Last Release

2063d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f1213dcfe9e33fe2e29cd5d40f53d9bbcd5c6149f92ec1dd6e1278c1691b458d?d=identicon)[hw520](/maintainers/hw520)

---

Top Contributors

[![hewei520](https://avatars.githubusercontent.com/u/38216632?v=4)](https://github.com/hewei520 "hewei520 (14 commits)")

### Embed Badge

![Health badge](/badges/hw-lib-php/health.svg)

```
[![Health](https://phpackages.com/badges/hw-lib-php/health.svg)](https://phpackages.com/packages/hw-lib-php)
```

###  Alternatives

[topthink/think-captcha

captcha package for thinkphp

132934.4k68](/packages/topthink-think-captcha)[topthink/think-worker

workerman extend for thinkphp

202227.2k9](/packages/topthink-think-worker)[yunwuxin/think-cron

计划任务

17416.2k](/packages/yunwuxin-think-cron)[zzstudio/think-addons

The ThinkPHP6 Addons Package

1518.6k](/packages/zzstudio-think-addons)[topthink/think-annotation

Annotation For ThinkPHP

4831.5k8](/packages/topthink-think-annotation)[liliuwei/thinkphp-jump

适用于thinkphp6.0的跳转扩展

2874.4k1](/packages/liliuwei-thinkphp-jump)

PHPackages © 2026

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