{"id":33955409,"url":"https://github.com/next-laboratory/simple","last_synced_at":"2026-03-17T16:32:21.986Z","repository":{"id":37690245,"uuid":"479962583","full_name":"next-laboratory/simple","owner":"next-laboratory","description":"一款支持swoole/workerman/cli-server/FPM环境的PHP开发骨架。可以自行扩展支持amphp和reactphp","archived":false,"fork":false,"pushed_at":"2025-11-06T11:07:30.000Z","size":473,"stargazers_count":26,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-14T12:16:27.942Z","etag":null,"topics":["aop","container","framework","http","swoole","workerman"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/next-laboratory.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-04-10T08:53:11.000Z","updated_at":"2025-11-06T11:06:24.000Z","dependencies_parsed_at":"2023-10-17T05:22:51.245Z","dependency_job_id":"b9bd9319-9e2c-43a4-9ace-8e918a442155","html_url":"https://github.com/next-laboratory/simple","commit_stats":{"total_commits":353,"total_committers":5,"mean_commits":70.6,"dds":0.5155807365439093,"last_synced_commit":"c8e15fb7f4595cdfb9df348d1b3f199eaa5bc19c"},"previous_names":["next-laboratory/simple","marxphp/simple","topyao/max-swoole-project"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/next-laboratory/simple","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/next-laboratory%2Fsimple","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/next-laboratory%2Fsimple/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/next-laboratory%2Fsimple/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/next-laboratory%2Fsimple/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/next-laboratory","download_url":"https://codeload.github.com/next-laboratory/simple/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/next-laboratory%2Fsimple/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30627165,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T14:16:03.965Z","status":"ssl_error","status_checked_at":"2026-03-17T14:16:03.380Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["aop","container","framework","http","swoole","workerman"],"created_at":"2025-12-12T20:03:03.949Z","updated_at":"2026-03-17T16:32:21.980Z","avatar_url":"https://github.com/next-laboratory.png","language":"PHP","readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/next-laboratory/simple/master/public/favicon.ico\" width=\"120\" alt=\"Max\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e轻量 • 简单 • 快速\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/next-laboratory/simple/issues\"\u003e\u003cimg src=\"https://img.shields.io/github/issues/next-laboratory/simple\" alt=\"\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/next-laboratory/simple\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/next-laboratory/simple\" alt=\"\"\u003e\u003c/a\u003e\n\u003cimg src=\"https://img.shields.io/badge/php-%3E%3D8.2-brightgreen\" alt=\"\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/license-apache%202-blue\" alt=\"\"\u003e\n\u003c/p\u003e\n\n一款支持swoole, workerman, FPM环境的组件化的轻量`PHP`框架\n\n## 环境要求\n\n```\nPHP  ^8.2\n```\n\n\u003e 如果使用swoole，务必安装4.6以上版本，如果使用workerman, 务必使用4.0以上版本\n\n## 使用\n\n### 安装\n\n```shell\ncomposer config -g repo.packagist composer https://repo.packagist.org # 更换官方仓库\ncomposer create-project next/simple\n```\n\n### 启动服务\n\n```php\nphp bin/cli-server.php           // 内置服务\nphp bin/swoole.php               // swoole\nphp bin/workerman.php            // workerman\n```\n\n\u003e FPM模式，将请求指向public/index.php即可\n\n## 区别\n\n使用swoole/workerman/amp/react等服务支持注解、AOP等特性， FPM模式可以直接卸载AOP包。\n\n## 简单入门\n\n### 路由定义\n\n\u003e 路由定义在 `app/router.php` 文件中，也可以使用注解定义（需要安装AOP包，且不支持FPM/内置服务）\n\n下面是在`app/router.php`中定义的路由\n\n```php\n$router-\u003emiddleware(new SessionMiddleware(), new VerifyCSRFToken())\n   -\u003egroup(function (Router $router) {\n       $router-\u003eget('/', [new IndexController(), 'index']);\n       $router-\u003eget('openapi', [new IndexController(), 'opanapi']);\n   });\n```\n\n当你使用swoole/swoole/workerman/amp/reactphp并且使用了AOP就可以使用注解定义\n\n```php\n\u003c?php\n\nnamespace App\\Controllers;\n\nuse App\\Http\\Response;use Next\\Routing\\Attribute\\Controller;use Next\\Routing\\Attribute\\GetMapping;use Psr\\Http\\Message\\ResponseInterface;use Psr\\Http\\Message\\ServerRequestInterface;\n\n#[Controller(prefix: '/')]\nclass IndexController\n{\n    #[GetMapping(path: '/')]\n    public function index(ServerRequestInterface $request): ResponseInterface\n    {\n        return Response::HTML('Hello, ' . $request-\u003equery('name', 'nextphp!'));\n    }\n}\n\n```\n\n如上请求`0.0.0.0:8989` 会指向`index`方法，控制器方法支持依赖注入，如需当前请求示例，则请求参数名必须是`request`\n，其他路由参数均会被注入，控制器方法需要返回`ResponseInterface`实例。\n\n### 其他文档\n\n其他文档参考相应包的`README`\n\n## 参与开发\n\n欢迎有兴趣的朋友参与开发\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnext-laboratory%2Fsimple","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnext-laboratory%2Fsimple","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnext-laboratory%2Fsimple/lists"}