PHPackages                             jeen/yafapi - 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. [API Development](/categories/api)
4. /
5. jeen/yafapi

ActiveProject[API Development](/categories/api)

jeen/yafapi
===========

yaf api project

0.0.6(9y ago)2222MITPHP

Since Jul 26Pushed 9y ago1 watchersCompare

[ Source](https://github.com/vsfor/yafapi)[ Packagist](https://packagist.org/packages/jeen/yafapi)[ RSS](/packages/jeen-yafapi/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (7)Used By (0)

使用yaf搭建的简易API服务框架
=================

[](#使用yaf搭建的简易api服务框架)

**测试环境 及 配置说明**

```
php v7.0.7
yaf v3.0.3
yar v2.0.1

mysql 5.6.21
nginx 1.10.1

=============
php ini example:
;php extension for yaf
extension = yaf.so
yaf.use_namespace=1
yaf.use_spl_autoload=1
;php extension for yar ,timeout ms
extension = msgpack.so
extension = yar.so
yar.timeout = 3000

============
nginx conf example:
server
{
        listen       80;
        server_name  yafapi.local.com;
        index index.php;
        root  /data/www/yaf/yafapi/apiopen/web;

        if (!-e $request_filename) {
                rewrite ^(.*)$ /index.php/$1 last;
        }

        location ~ [^/]\.php(/|$)
        {
                fastcgi_pass  127.0.0.1:9007;
                fastcgi_index index.php;
                include fastcgi.conf;
        }

        access_log  off;
}

```

### 项目模块

[](#项目模块)

- apiopen 用于开放 api 调用
- apiyar 用于 rpc 调用 基于yar
- console 用于 cli 命令行处理
- common 包含一些 核心类 及 数据模型
- tests 包含项目phpunit测试文件
- var 用于项目log,session,cache的存储
- vendor 一些扩展及三方工具类

### J\_ENV 环境分级

[](#j_env-环境分级)

**需创建与之对应的配置文件 - 建议四级**

- local - 本地
- alpha - 测试线
- beta - 预发布
- stable - 正式线

**可根据项目实际部署环境调整**

### J\_DEBUG 全局调试开关

[](#j_debug-全局调试开关)

**建议用于调试日志记录**

#### 其他备注

[](#其他备注)

- 目录权限 chmod -R 0777 /path/to/yafapi/var
- 建议接口返回的布尔值 统一使用 0 1 代替
- 建议返回值键名规避各变成语言的关键字和保留字

**注意**

*使用 api yar 时,需要配置中的 vendor/jeen/JApi apiUrl与相关服务环境的配置*

#### Api Open 请求参数说明

[](#api-open-请求参数说明)

**建议 使用 如下参数格式，用于安全校验**

参数名必要类型说明范例systemType否string系统类型iphone 6s plus,HuaWei P9 MAXsystemVersion否string系统版本ios 9.1.2, android 5.0.1systemMAC否string系统网卡地址0f:00:23:e2:ed:12systemIMEI否string手机IMEI830123123123123systemIDFA否stringiOS idfaifajs-asdlf-asfdjl-asdfappType是int应用类型0未知,1android,2ios,3web,...appVersion是string应用版本1.2.8timeStamp是intUnix 10位整型时间戳1401230123apiToken是string接口调用令牌，指定或约定算法生成dlfw932lfasff...userId是int/string用户ID(唯一标识)692343993userToken是string用户会话令牌(用于登录校验)ijfwafjsjd89s8df8aapiName是string调用接口名称test\_index\_testapiParams是json(array/dict/map)接口请求参数{a:"b",c:3}sign是string签名值,约定的签名算法oiasldkf*更多说明待完善*

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

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

6

Last Release

3619d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1228579?v=4)[Jeen](/maintainers/vsfor)[@vsfor](https://github.com/vsfor)

---

Top Contributors

[![vsfor](https://avatars.githubusercontent.com/u/1228579?v=4)](https://github.com/vsfor "vsfor (11 commits)")

### Embed Badge

![Health badge](/badges/jeen-yafapi/health.svg)

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

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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