phphleb/api-multitool
Composer 安装命令:
composer require phphleb/api-multitool
包简介
A set of traits for creating an API
关键字:
README 文档
README
Can be used either separately or in conjunction with the HLEB2 framework: github.com/phphleb/hleb
The set represents independent traits, each of which implements highly specialized methods that are used in controllers.
Installation
Using Composer
composer require "phphleb/api-multitool:^2.0"
or download the library to the 'vendor/phphleb/api-multitool' folder.
BaseApiTrait
All auxiliary traits are collected in the trait BaseApiTrait as a set. Therefore, it is enough to connect it to the controller and get a complete implementation. If another set of these traits is needed, then you need to either use them as a group or combine them into your own set. It is best to include such a trait in the parent class of controllers that implement the API, so as not to have to do this for everyone.
For the HLEB2 framework it might look like this (implementation example):
<?php // File /app/Controllers/Api/BaseApiActions.php namespace App\Controllers\Api; use Hleb\Base\Controller; use Phphleb\ApiMultitool\BaseApiTrait; class BaseApiActions extends Controller { // Adding a set of traits for the API. use BaseApiTrait; function __construct(array $config = []) { parent::__construct($config); // Passing the debug mode value to the API constructor. $this->setApiBoxDebug($this->container->settings()->isDebug()); } }
After this, all controllers inheriting from this class will have methods from each trait in the set.
More details can be found in the framework documentation.
Testing
API traits tested using github.com/phphleb/api-tests
phphleb/api-multitool 适用场景与选型建议
phphleb/api-multitool 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 29 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 10 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 phphleb/api-multitool 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 phphleb/api-multitool 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 phphleb/api-multitool 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PSR-7 compatible library for making CRUD API endpoints
A lightweight plain-PHP framework for database-backed CRUD APIs.
Modern, strongly-typed, PSR-compliant PHP client for the WeFact v2 API.
PHP SDK for the Enconvert file conversion API
支付宝开放平台v3协议文档,支持最新版PHP8+
Usgm PHP Library
统计信息
- 总下载量: 29
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-10-07