PHPackages                             unntech/liteapi - 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. [Framework](/categories/framework)
4. /
5. unntech/liteapi

ActiveProject[Framework](/categories/framework)

unntech/liteapi
===============

A lite php Framework for api provide

v1.0.7(12mo ago)017MITPHPPHP &gt;=7.2

Since Feb 2Pushed 11mo agoCompare

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

READMEChangelog (7)Dependencies (1)Versions (8)Used By (0)

LiteApi 1.0
===========

[](#liteapi-10)

[![Latest Stable Version](https://camo.githubusercontent.com/a08df3977d069437c7c27d6e58d6e2ae8e68fae6cc74de78685d5952187bd61c/68747470733a2f2f706f7365722e707567782e6f72672f756e6e746563682f6c6974656170692f762f737461626c65)](https://packagist.org/packages/unntech/liteapi)[![Total Downloads](https://camo.githubusercontent.com/6d827c24d7353b3fa33df636d242ae013efdc19dfbc5ab2c3c22698cb18cfe50/68747470733a2f2f706f7365722e707567782e6f72672f756e6e746563682f6c6974656170692f646f776e6c6f616473)](https://packagist.org/packages/unntech/liteapi)[![Latest Unstable Version](https://camo.githubusercontent.com/bca70745b575dde6287ed5cc15c2f1fc5c70f99f9875d977da25613a83dcdc34/687474703a2f2f706f7365722e707567782e6f72672f756e6e746563682f6c6974656170692f762f756e737461626c65)](https://packagist.org/packages/unntech/liteapi)[![PHP Version Require](https://camo.githubusercontent.com/8b047fd658c1b1f6215fb7b08b0450141bd6764277657e9939a7461c4a1b5d01/687474703a2f2f706f7365722e707567782e6f72672f756e6e746563682f6c6974656170692f726571756972652f706870)](https://packagist.org/packages/unntech/liteapi)[![License](https://camo.githubusercontent.com/35f0e6f284d7221efd638b137897e0452c311398bcf22bb775eb74bd3d7e05aa/68747470733a2f2f706f7365722e707567782e6f72672f756e6e746563682f6c6974656170692f6c6963656e7365)](https://packagist.org/packages/unntech/liteapi)

基于PHP Swoole 创建的协程框架，可用于生产环境的高性能API接口。

主要新特性
-----

[](#主要新特性)

- 采用`PHP7`强类型（严格模式）
- 支持更多的`PSR`规范
- 原生多应用支持
- 对Swoole以及协程支持
- 对IDE更加友好
- 统一和精简大量用法

> LiteApi 1.0的运行环境要求PHP7.0+，兼容PHP8.1 需要安装 ext-swoole 扩展
>
> 建议使用 LiteSwoole 2.0

安装
--

[](#安装)

```
composer create-project unntech/liteapi yourApp

```

```
将目录config.sample 改名为 config，可以更据需求增加配置文件
读取例子见：tests/sample.config.php

```

启动HttpApi服务

```
cd yourApp
./http.sh start    (#chmod +x http.sh 先赋予可执行权限)

```

然后就可以在浏览器中访问

```
http://localhost:9898/authorize  #获取TOKEN

http://localhost:9898/sampleApi/test

```

```
访问的路径对应/api/controller/文件名/函数名

```

启动WebSocket服务

```
cd yourApp
./websocket.sh start    (#chmod +x websocket.sh 先赋予可执行权限)

```

然后就可以使用进行websocket连接

```
ws://localhost:9899

```

```
/api/WebSocket.php 对应方法处理相应的事件过程

```

如果需要更新框架使用

```
composer update unntech/litephp

```

目录结构

```
yourApp/
├── api                                     #LiteApi命名空间
│   ├── controller                          #Api接口控制器方法目录，支持分项多级子目录
│   ├── ...                                 #其它子模块
│   ├── HttpApi.php                         #接口调用类
│   ├── HttpRequest.php                     #控制器调用基础类
│   ├── LiApiCommVar.php                    #共享公用变量类
│   ├── LiteApi.php                         #LiteApi通用类，自动载入，默认全局变量$Lite
│   ├── WebSketRepo.php                     #LiWebSocket 基础类
│   ├── WebSocket.php                       #LiWebSocket 基础类
├── config                                  #配置文件
│   ├── app.php                             #项目基础配置
│   ├── db.php                              #数据库配置文件
│   ├── redis.php                           #redis配置文件
│   ├── websocket.php                       #WebSocket配置文件
│   ├── httpapi.php                         #HttpApi配置文件
├── docs                                    #文档
│   ├── liteapi.sql                         #基础数据库表
├── include                                 #通用函数库
│   ├── common.php                          #全局通用函数
├── log                                     #日志目录
├── tests                                   #测试样例，可删除
├── vendor                                  #composer目录
├── autoload.php                            #autoload载入主程序
├── composer.json                           #
├── http.sh                                 #HttpApi启动命令
├── httpapi.php                             #HttpApi主程序
├── websocket.php                           #websocket主程序
├── websocket.sh                            #WebSocket启动命令
└── README.md

```

文档
--

[](#文档)

[完全开发手册](#)

命名规范
----

[](#命名规范)

`LiteApi`遵循PSR-2命名规范和PSR-4自动加载规范。

参与开发
----

[](#参与开发)

直接提交PR或者Issue即可

版权信息
----

[](#版权信息)

LiteApi遵循MIT开源协议发布，并提供免费使用。

本项目包含的第三方源码和二进制文件之版权信息另行标注。

版权所有Copyright © 2022 by Jason Lin All rights reserved。

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance51

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

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

Recently: every ~300 days

Total

7

Last Release

364d ago

PHP version history (2 changes)v1.0.1PHP &gt;=7.0

v1.0.6PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/41ed0737519313bb52a1c118a720dd65f4c238a2a805825eeef7bf2b41e05bfa?d=identicon)[unntech](/maintainers/unntech)

---

Top Contributors

[![unntech](https://avatars.githubusercontent.com/u/98684048?v=4)](https://github.com/unntech "unntech (28 commits)")

### Embed Badge

![Health badge](/badges/unntech-liteapi/health.svg)

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

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

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