{"id":13669178,"url":"https://github.com/caoym/phpboot","last_synced_at":"2026-01-11T11:02:56.614Z","repository":{"id":55093888,"uuid":"43870568","full_name":"caoym/phpboot","owner":"caoym","description":":coffee: 🚀 tiny \u0026 fast PHP framework for building Microservices/RESTful APIs, with useful  features: IOC, Hook, ORM, RPC, Swagger, Annotation, Parameters binding, Validation, etc.","archived":false,"fork":false,"pushed_at":"2021-06-02T05:15:14.000Z","size":1184,"stargazers_count":657,"open_issues_count":6,"forks_count":175,"subscribers_count":76,"default_branch":"master","last_synced_at":"2024-07-09T08:42:04.583Z","etag":null,"topics":["annotation","framework","microservices","orm","restful","rpc","swagger"],"latest_commit_sha":null,"homepage":"http://phpboot.org","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/caoym.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-08T07:37:41.000Z","updated_at":"2024-07-01T21:36:52.000Z","dependencies_parsed_at":"2022-08-14T11:50:14.155Z","dependency_job_id":null,"html_url":"https://github.com/caoym/phpboot","commit_stats":null,"previous_names":["caoym/phprs-restful"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caoym%2Fphpboot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caoym%2Fphpboot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caoym%2Fphpboot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caoym%2Fphpboot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caoym","download_url":"https://codeload.github.com/caoym/phpboot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251077102,"owners_count":21532607,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["annotation","framework","microservices","orm","restful","rpc","swagger"],"created_at":"2024-08-02T08:01:05.221Z","updated_at":"2026-01-11T11:02:56.608Z","avatar_url":"https://github.com/caoym.png","language":"PHP","funding_links":[],"categories":["类库","PHP","开源项目"],"sub_categories":["API"],"readme":"# PhpBoot\n\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/caoym/phpboot/master/LICENSE)\n[![Package version](http://img.shields.io/packagist/v/caoym/phpboot.svg)](https://packagist.org/packages/caoym/phpboot)\n[![Documentation Status](https://readthedocs.org/projects/phpboot/badge/?version=latest)](http://phpboot.readthedocs.io/zh/latest/?badge=latest)\n[![Build Status](https://travis-ci.org/caoym/phpboot.svg?branch=master)](https://travis-ci.org/caoym/phpboot)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/caoym/phpboot/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/caoym/phpboot/?branch=master)\n[![Code Coverage](https://scrutinizer-ci.com/g/caoym/phpboot/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/caoym/phpboot/?branch=master)\n\n\u003e phprs-restful 2.x is renamed to PhpBoot, and incompatible with 1.x. You can get the old version from [phprs-restful v1.x](https://github.com/caoym/phprs-restful/tree/v1.2.4)\n\n[查看中文说明](https://github.com/caoym/phpboot/blob/master/README.zh.md)\n\n**[PhpBoot](https://github.com/caoym/phpboot)** is an easy and powerful PHP framework for building RESTful/Microservices APIs.\n\n## Specialities\n\nPhpBoot provides mainstream features, such as IOC, HOOK, ORM, Validation, etc. But the most striking features are:\n\n### 1. Designing object-oriented APIs\n\n**WITHOUT**  PhpBoot:\n\n```PHP\nclass BookController\n{\n    public function findBooks(Request $request)\n    {\n        $name = $request-\u003eget('name');\n        $offset = $request-\u003eget('offset', 0);\n        $limit = $request-\u003eget('limit', 10);\n        ...\n        return new Response(['total'=\u003e$total, 'data'=\u003e$books]);\n    }\n    \n    public function createBook(Request $request)\n    ...\n}\n```\n\n**WITH**  PhpBoot:\n\n```PHP\n/**\n * @path /books/\n */\nclass Books\n{\n    /**\n     * @route GET /\n     * @return Book[]\n     */\n    public function findBooks($name, \u0026$total=null, $offset=0, $limit=10)\n    {\n        $total = ...\n        ...\n        return $books;\n    }\n  \n    /**\n     * @route POST /\n     * @param Book $book {@bind request.request} bind $book with http body\n     * @return string id of created book\n     */\n    public function createBook(Book $book)\n    {\n        $id = ... \n        return $id;\n    }\n}\n```\nRead more: [phpboot-example](https://github.com/caoym/phpboot-example)。\n    \n### 2. Swagger\n\nPhpBoot can automatically generate Swagger JSON，which can be rendered as document by Swagger UI like this：\n\n\u003cdiv\u003e\n\u003cimg src=\"https://github.com/caoym/phpboot/raw/master/docs/_static/WX20170809-184015.png\" width=\"60%\"\u003e\n\u003c/div\u003e\n\nRead more: [Online Demo](http://swagger.phpboot.org/?url=http://example.phpboot.org/docs/swagger.json)\n\n### 3. RPC\n\nCall the remote Books with RPC:\n\n```PHP\n$books = $app-\u003emake(RpcProxy::class, [\n        'interface'=\u003eBooks::class, \n        'prefix'=\u003e'http://x.x.x.x/'\n    ]);\n    \n$books-\u003efindBooks(...);\n```\n\nConcurrent call RPC：\n\n```PHP\n$res = MultiRpc::run([\n    function()use($service1){\n        return $service1-\u003edoSomething();\n    },\n    function()use($service2){\n        return $service2-\u003edoSomething();\n    },\n]);\n```\n\nRead more: [RPC](http://phpboot.org/zh/latest/advanced/rpc.html)\n\n### 4. IDE friendly \n\n\u003cdiv\u003e\n\u003cimg src=\"https://github.com/caoym/phpboot/raw/master/docs/_static/db.gif\"\u003e\n\u003c/div\u003e\n\n## Features\n   \n   * [Route](http://phpboot.org/zh/latest/basic/route.html)\n   * [Parameters binding ](http://phpboot.org/zh/latest/basic/params-bind.html)\n   * [Validation](http://phpboot.org/zh/latest/basic/validation.html)\n   * [Dependency Injection(IOC)](http://phpboot.org/zh/latest/basic/di.html)\n   * [DB](http://phpboot.org/zh/latest/basic/db.html)\n   * [ORM](http://phpboot.org/zh/latest/advanced/orm.html)\n   * [Docgen(Swagger)](http://phpboot.org/zh/latest/advanced/docgen.html)\n   * [RPC](http://phpboot.org/zh/latest/advanced/rpc.html)\n   * [Hook](http://phpboot.org/zh/latest/advanced/hook.html)\n   * [CLI](http://phpboot.org/zh/latest/advanced/cli.html)\n## Installation\n\n   1. Install composer\n\n\t   ```\n\t   curl -s http://getcomposer.org/installer | php\n\t   ```\n       \n   2. Install PhpBoot\n   \n       ```\n       composer require \"caoym/phpboot\"\n       ```\n       \n   3. index.php\n       \n       ```PHP\n       \u003c?php\n       require __DIR__.'/vendor/autoload.php';\n      \n       $app = \\PhpBoot\\Application::createByDefault(__DIR__.'/config/config.php');\n       $app-\u003eloadRoutesFromPath(__DIR__.'/App/Controllers');\n       $app-\u003edispatch();\n       ```\n   \n## Help \u0026 Documentation\n\n   * **[Documentation](http://phpboot.org)**\n   * **[中文文档](http://phpboot.org)**\n   * Email: caoyangmin@gmail.com\n   \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaoym%2Fphpboot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaoym%2Fphpboot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaoym%2Fphpboot/lists"}