kmuenkel/conduit
Composer 安装命令:
composer require --dev kmuenkel/conduit
包简介
Easily produce Adapter classes and dummy-responses for testing them
README 文档
README
This package allows for easy creation of API adapters. Extendable to include support for things like SOAP or FTP. Eloquent\Model-like structure, i.e. one class per endpoint that doubles as a response Struct. And Mockery-like ability to cordon off external calls and send back dummy-responses for the sake of PhpUnit.
This borrows a lot of inspiration from Eloquent in how it's structured.
- "Endpoints" are as simple to spin up as Model classes. As the name suggests, one Endpoint class per external API endpoint you might want to communicate with.
- Similar to Model classes, these objects also serve as Structs for the response content, which has various normalizers that can parse HTML, XML, or JSON. Additional parsers can be added as needed, and be made Traversable if at all possible (similar to Collections).
- The "Adapter" class an Endpoint uses to convert its parameters has a compositional relationship with the Endpoint, largely to give ServiceProviders the opportunity to auto-inject some Middleware. Though most of the time, the Endpoint itself would supply that. (Like OAuth or SAML. These don't exist yet, but that's where you'd put them.) The Adapter can actually be leveraged independently of an Endpoint, similar to Models vs. Query-Builder.
- The request parameters are then send on to a Bridge, that would typically be a Facade for whatever mechanism ultimately sends the request off. (Like how Query-Builder uses DB Grammar classes.) Right now only a Guzzle (cURL) one exists, but by building a compositional relationship here dependent on the Interface rather than concrete class, we have the opportunity to add others, like SOAP or FTP.
kmuenkel/conduit 适用场景与选型建议
kmuenkel/conduit 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 309 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 01 月 31 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「generator」 「api」 「testing」 「adapter」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 kmuenkel/conduit 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kmuenkel/conduit 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 kmuenkel/conduit 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Memio's PrettyPrinter, used to generate PHP code from given Model
Testing Suite For Lumen like Laravel does.
A PSR-7 compatible library for making CRUD API endpoints
The PHP SDK for Checkmango
The testing extension of TYPO3voilà.
Phalcon Model Generator
统计信息
- 总下载量: 309
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-01-31