webchimp/chapi
Composer 安装命令:
composer create-project webchimp/chapi
包简介
CHIMP API
README 文档
README
Why
CHAPI stands for CHIMP API Powerful Integration (clever right?).
CHAPI is our take on how to manage an easy to use but still powerful API framework.
The objectives for CHAPI are:
- Elegant and simple for the programmer
- Flexible (CHAPI comes with a lot of automagic but its optional)
- Composer Compliant
Structure
CHAPI is aimed specifically to generate API's. This being said, the structure was created with RESTful implementations in mind. The main parts of CHAPI are the following:
Request Object
The request object lets you play with the request information made to the API. It comes with:
- Wrapper functions to manipulate
GET,POSTorPUTrequest information - Wrapper functions to use
$_SESSIONor$_FILES - Wrapper functions to manipulate Cookies and Server information
- Tools to get Authorization Headers and bearers
Response Object
The Response Object is a tool designed to facilitate the way the endpoint responds. It contains special functions to:
- Set the response status
- Set the response body
- Set any header
- Redirect to special locations
- Respond json in an easy way
Router
CHAPI's Router is a very powerful tool. It comes with an engine that lets you add and resolve routes in a straight-forward way.
Main advantages of CHAPI's Router are:
- Easy create
GET,POST,PUTandDELETEroutes - Named params
- Optional params
- Regex supported
Endpoint Class
The endpoint class uses all the power from Request, Response and Router. It creates a base to create endpoints without too much code. Out of the box, it comes with a specific set of automagic routes that define the basis for simple endpoints needed for CrUD operations and let you extend this however you want.
App Wrapper
Everything in CHAPI is wrapped, at the end, in an APP object that lets you access everything it has through one point.
webchimp/chapi 适用场景与选型建议
webchimp/chapi 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 137 次下载、GitHub Stars 达 1, 最近一次更新时间为 2021 年 10 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 webchimp/chapi 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 webchimp/chapi 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 137
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-10-23