Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

phpboot

> 数据库
Open source

:coffee: tiny & fast PHP framework for building Microservices/RESTful APIs, with useful features: IOC, Hook, ORM, RPC, Swagger, Annotation, Parameters bindi

649 stars0 likes2 views
WebsiteGitHub

About

:coffee: tiny & fast PHP framework for building Microservices/RESTful APIs, with useful features: IOC, Hook, ORM, RPC, Swagger, Annotation, Parameters bindi

PhpBoot

phprs-restful 2.x is renamed to PhpBoot, and incompatible with 1.x. You can get the old version from phprs-restful v1.x

查看中文说明

PhpBoot is an easy and powerful PHP framework for building RESTful/Microservices APIs.

Specialities

PhpBoot provides mainstream features, such as IOC, HOOK, ORM, Validation, etc. But the most striking features are:

1. Designing object-oriented APIs

WITHOUT PhpBoot:

php
class BookController
{
    public function findBooks(Request $request)
    {
        $name = $request->get('name');
        $offset = $request->get('offset', 0);
        $limit = $request->get('limit', 10);
        ...
        return new Response(['total'=>$total, 'data'=>$books]);
    }
    
    public function createBook(Request $request)
    ...
}

WITH PhpBoot:

php
/**
 * @path /books/
 */
class Books
{
    /**
     * @route GET /
     * @return Book[]
     */
    public function findBooks($name, &$total=null, $offset=0, $limit=10)
    {
        $total = ...
        ...
        return $books;
    }
  
    /**
     * @route POST /
     * @param Book $book {@bind request.request} bind $book with http body
     * @return string id of created book
     */
    public function createBook(Book $book)
    {
        $id = ... 
        return $id;
    }
}

Read more: phpboot-example。    

2. Swagger

PhpBoot can automatically generate Swagger JSON,which can be rendered as document by Swagger UI like this:

Read more: Online Demo

3. RPC

Call the remote Books with RPC:

php
$books = $app->make(RpcProxy::class, [
        'interface'=>Books::class, 
        'prefix'=>'http://x.x.x.x/'
    ]);
    
$books->findBooks(...);

Concurrent call RPC:

php
$res = MultiRpc::run([
    function()use($service1){
        return $service1->doSomething();
    },
    function()use($service2){
        return $service2->doSomething();
    },
]);

Read more: RPC

4. IDE friendly

Features

  • Route
  • Parameters binding
  • Validation
  • Dependency Injection(IOC)
  • DB
  • ORM
  • Docgen(Swagger)
  • RPC
  • Hook
  • CLI

Installation

  1. Install composer

    bash
    curl -s http://getcomposer.org/installer | php
  2. Install PhpBoot

    composer require "caoym/phpboot"
  3. index.php

    php
    loadRoutesFromPath(__DIR__.'/App/Controllers');
    $app->dispatch();

Help & Documentation

  • Documentation
  • 中文文档
  • Email: [email protected]

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHPannotationframeworkmicroservicesorm

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库