pizida
V2EX  ›  问与答

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

  •  
  •   pizida · Jun 11, 2018 · 12336 views
    This topic created in 2917 days ago, the information mentioned may be changed or developed.

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

    24 replies    2018-06-12 14:36:03 +08:00
    ibugeek
        1
    ibugeek  
       Jun 11, 2018
    只做 api 的话,我觉得 lumen 还是不错的。
    Mariano
        2
    Mariano  
       Jun 11, 2018
    lumen
    iamsee
        3
    iamsee  
       Jun 11, 2018
    yaf
    GG668v26Fd55CP5W
        4
    GG668v26Fd55CP5W  
       Jun 11, 2018 via iPhone
    slim
    hahasong
        5
    hahasong  
       Jun 11, 2018
    yaf
    qqjt
        6
    qqjt  
       Jun 11, 2018
    laravel,使用 lumen 到头来还是会转成 laravel
    loginv2
        7
    loginv2  
       Jun 11, 2018
    easyswoole
    Mcfzy
        8
    Mcfzy  
       Jun 11, 2018
    lumen
    gouchaoer2
        9
    gouchaoer2  
       Jun 11, 2018 via Android   ❤️ 1
    api 说到底如果 io 很重(比如你 api 里面有 rpc 之类的)的话 fpm 本身就不适合,并发比较大的话考虑一下 swoft,另外别用 laravel 性能太差了
    visonme
        10
    visonme  
       Jun 11, 2018
    slim, 不过自己在这个基础上做了扩展,可以考虑下~
    tanszhe
        11
    tanszhe  
       Jun 11, 2018
    https://github.com/lizhichao/one
    快如闪电
    支持 fpm | swoole 两种模式
    全局模型可缓存(自动刷新)
    多重路由支持 缓存 中间件
    ……
    kzzhr
        12
    kzzhr  
       Jun 11, 2018 via Android
    lumen on swoole
    a7a2
        13
    a7a2  
       Jun 11, 2018
    Phalcon
    放弃 php 吧 真不适合做高负载 api 开发
    ddiu8081
        14
    ddiu8081  
       Jun 11, 2018
    在用 lumen
    HanSonJ
        15
    HanSonJ  
       Jun 11, 2018
    lumen
    TonyG
        16
    TonyG  
       Jun 11, 2018
    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
        17
    wellCh4n  
       Jun 11, 2018
    TP5 官方的广告上说:ThinkPHP V5.0 是一个为 API 开发而设计的高性能框架。
    SoulGem
        18
    SoulGem  
       Jun 11, 2018 via iPhone
    slim3
    puritania
        19
    puritania  
       Jun 11, 2018 via iPhone
    yaf
    nicevar
        20
    nicevar  
       Jun 11, 2018
    最近给 app 做了后端用的 CI,感觉还行
    hubahuba
        21
    hubahuba  
       Jun 12, 2018 via Android
    @a7a2 那什么适合?
    askfilm
        22
    askfilm  
       Jun 12, 2018
    symfony + api-platform
    askfilm
        23
    askfilm  
       Jun 12, 2018
    或 symfony + fosrestbundle
    jingrui
        24
    jingrui  
       Jun 12, 2018 via iPhone
    国内吗? tp5/tp3 是个 php 都会用
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2673 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 76ms · UTC 11:19 · PVG 19:19 · LAX 04:19 · JFK 07:19
    ♥ Do have faith in what you're doing.