PHP 做 api 开发选择哪一个框架比较是适合

2018-06-11 15:04:59 +08:00
 pizida

从团队维护和框架性能两方面作为主要因素去看,选择哪一块 PHP 框架比较适合? 目前准备在 phalcon 和 tp5 中选择一个。大家可以给点建议吗

11298 次点击
所在节点    问与答
24 条回复
ibugeek
2018-06-11 15:44:17 +08:00
只做 api 的话,我觉得 lumen 还是不错的。
Mariano
2018-06-11 16:23:08 +08:00
lumen
iamsee
2018-06-11 16:31:19 +08:00
yaf
falcon05
2018-06-11 16:40:37 +08:00
slim
hahasong
2018-06-11 16:42:20 +08:00
yaf
qqjt
2018-06-11 16:43:17 +08:00
laravel,使用 lumen 到头来还是会转成 laravel
loginv2
2018-06-11 18:04:33 +08:00
easyswoole
5748hao
2018-06-11 19:39:31 +08:00
lumen
gouchaoer2
2018-06-11 19:49:40 +08:00
api 说到底如果 io 很重(比如你 api 里面有 rpc 之类的)的话 fpm 本身就不适合,并发比较大的话考虑一下 swoft,另外别用 laravel 性能太差了
visonme
2018-06-11 19:51:36 +08:00
slim, 不过自己在这个基础上做了扩展,可以考虑下~
tanszhe
2018-06-11 19:56:09 +08:00
https://github.com/lizhichao/one
快如闪电
支持 fpm | swoole 两种模式
全局模型可缓存(自动刷新)
多重路由支持 缓存 中间件
……
kzzhr
2018-06-11 20:33:36 +08:00
lumen on swoole
a7a2
2018-06-11 20:47:43 +08:00
Phalcon
放弃 php 吧 真不适合做高负载 api 开发
ddiu8081
2018-06-11 21:33:57 +08:00
在用 lumen
HanSonJ
2018-06-11 21:50:16 +08:00
lumen
TonyG
2018-06-11 21:58:46 +08:00
https://api-platform.com/

API Platform uses these model classes to expose a web API having a bunch of built-in features:

* creating, retrieving, updating and deleting (CRUD) resources
* data validation
* pagination
* filtering
* sorting
* hypermedia/HATEOAS and content negotiation support (JSON-LD, HAL, JSON API)
* GraphQL support
* Nice UI and machine-readable documentations (Swagger/OpenAPI, Hydra)
* authentication (Basic HTTP, cookies as well as JWT and OAuth through extensions)
* CORS headers
* security checks and headers (tested against OWASP recommendations)
* invalidation-based HTTP caching
* and basically everything needed to build modern APIs.

One more thing, before we start: as the API Platform distribution includes the Symfony framework, it is compatible with most Symfony bundles (plugins) and benefits from the numerous extensions points provided by this rock-solid foundation (events, DIC...). Adding features like custom, service-oriented, API endpoints, JWT or OAuth authentication, HTTP caching, mail sending or asynchronous jobs to your APIs is straightforward.
wellCh4n
2018-06-11 23:27:52 +08:00
TP5 官方的广告上说:ThinkPHP V5.0 是一个为 API 开发而设计的高性能框架。
SoulGem
2018-06-11 23:28:10 +08:00
slim3
puritania
2018-06-11 23:31:33 +08:00
yaf
nicevar
2018-06-11 23:52:30 +08:00
最近给 app 做了后端用的 CI,感觉还行

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/462168

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX