{"id":17955690,"url":"https://github.com/limingxinleo/swoft-project","last_synced_at":"2025-03-25T02:30:57.673Z","repository":{"id":57015125,"uuid":"138589207","full_name":"limingxinleo/swoft-project","owner":"limingxinleo","description":"基于Swoft的项目结构","archived":false,"fork":false,"pushed_at":"2019-01-17T01:33:26.000Z","size":154,"stargazers_count":16,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-19T06:43:05.275Z","etag":null,"topics":["php","project","swoft","swoole"],"latest_commit_sha":null,"homepage":null,"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/limingxinleo.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":"2018-06-25T12:01:23.000Z","updated_at":"2023-04-03T02:44:48.000Z","dependencies_parsed_at":"2022-08-22T09:31:32.804Z","dependency_job_id":null,"html_url":"https://github.com/limingxinleo/swoft-project","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limingxinleo%2Fswoft-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limingxinleo%2Fswoft-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limingxinleo%2Fswoft-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limingxinleo%2Fswoft-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/limingxinleo","download_url":"https://codeload.github.com/limingxinleo/swoft-project/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245385308,"owners_count":20606644,"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":["php","project","swoft","swoole"],"created_at":"2024-10-29T10:31:45.430Z","updated_at":"2025-03-25T02:30:57.371Z","avatar_url":"https://github.com/limingxinleo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/swoft-cloud/swoft\" target=\"_blank\"\u003e\n        \u003cimg src=\"http://qiniu.daydaygo.top/swoft-logo.png?imageView2/2/w/300\" alt=\"swoft\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n[![Latest Version](https://img.shields.io/badge/beta-v1.0.0-green.svg?maxAge=2592000)](https://github.com/swoft-cloud/swoft/releases)\n[![Build Status](https://travis-ci.org/swoft-cloud/swoft.svg?branch=master)](https://travis-ci.org/swoft-cloud/swoft)\n[![Build Status](https://travis-ci.org/limingxinleo/swoft-project-test.svg?branch=master)](https://travis-ci.org/limingxinleo/swoft-project-test)\n[![Php Version](https://img.shields.io/badge/php-%3E=7.0-brightgreen.svg?maxAge=2592000)](https://secure.php.net/)\n[![Swoole Version](https://img.shields.io/badge/swoole-%3E=2.1.1-brightgreen.svg?maxAge=2592000)](https://github.com/swoole/swoole-src)\n[![Hiredis Version](https://img.shields.io/badge/hiredis-%3E=0.1-brightgreen.svg?maxAge=2592000)](https://github.com/redis/hiredis)\n[![Swoft Doc](https://img.shields.io/badge/docs-passing-green.svg?maxAge=2592000)](https://doc.swoft.org)\n[![Swoft License](https://img.shields.io/hexpm/l/plug.svg?maxAge=2592000)](https://github.com/swoft-cloud/swoft/blob/master/LICENSE)\n\n\n# 简介\n首个基于 Swoole 原生协程的新时代 PHP 高性能协程全栈组件化框架，内置协程网络服务器及常用的协程客户端，常驻内存，不依赖传统的 PHP-FPM，全异步非阻塞 IO 实现，以类似于同步客户端的写法实现异步客户端的使用，没有复杂的异步回调，没有繁琐的 yield，有类似 Go 语言的协程、灵活的注解、强大的全局依赖注入容器、完善的服务治理、灵活强大的 AOP、标准的 PSR 规范实现等等，可以用于构建高性能的Web系统、API、中间件、基础服务等等。\n\n- 基于 Swoole 扩展\n- 内置协程 HTTP, TCP, WebSocket 网络服务器\n- 强大的 AOP (面向切面编程)\n- 灵活完善的注解功能\n- 全局的依赖注入容器\n- 基于 PSR-7 的 HTTP 消息实现\n- 基于 PSR-14 的事件管理器\n- 基于 PSR-15 的中间件\n- 基于 PSR-16 的缓存设计\n- 可扩展的高性能 RPC\n- 完善的服务治理，熔断，降级，负载，注册与发现\n- 数据库 ORM\n- 通用连接池\n- 协程 Mysql, Redis, RPC, HTTP 客户端\n- 协程和同步阻塞客户端无缝自动切换\n- 协程、异步任务投递\n- 自定义用户进程\n- RESTful 支持\n- 国际化(i18n)支持\n- 高性能路由\n- 快速灵活的参数验证器\n- 别名机制\n- 强大的日志系统\n- 跨平台热更新自动 Reload\n\n\n# 文档\n[**中文文档**](https://doc.swoft.org)\n\nQQ 交流群: 548173319\n\n# 环境要求\n\n1. PHP 7.0 +\n2. [Swoole 2.1.1](https://github.com/swoole/swoole-src/releases) +, 需开启协程和异步Redis\n3. [Hiredis](https://github.com/redis/hiredis/releases)\n4. [Composer](https://getcomposer.org/)\n\n# 安装\n\n## 手动安装\n\n* Clone 项目\n* 安装依赖 `composer install`\n\n## Composer 安装\n\n* `composer create-project swoft/swoft swoft`\n\n## Docker 安装\n\n* `docker run -p 80:80 swoft/swoft`\n\n## Docker-Compose 安装\n\n* `cd swoft`\n* `docker-compose up`\n\n# 配置\n\n若在执行 `composer install` 的时候由程序自动复制环境变量配置文件失败，则可手动复制项目根目录的 `.env.example` 并命名为 `.env`，注意在执行 `composer update` 时并不会触发相关的复制操作\n\n```\n# Server\nPFILE=/tmp/swoft.pid\nPNAME=php-swoft\nTCPABLE=true\nCRONABLE=false\nAUTO_RELOAD=true\n\n# HTTP\nHTTP_HOST=0.0.0.0\nHTTP_PORT=80\n\n# WebSocket\nWS_ENABLE_HTTP=true\n\n# TCP\nTCP_HOST=0.0.0.0\nTCP_PORT=8099\nTCP_PACKAGE_MAX_LENGTH=2048\nTCP_OPEN_EOF_CHECK=false\n\n# Crontab\nCRONTAB_TASK_COUNT=1024\nCRONTAB_TASK_QUEUE=2048\n\n# Settings\nWORKER_NUM=1\nMAX_REQUEST=10000\nDAEMONIZE=0\nDISPATCH_MODE=2\nLOG_FILE=@runtime/swoole.log\nTASK_WORKER_NUM=1\n```\n\n## 管理\n\n### 帮助命令\n\n```text\n[root@swoft]# php bin/swoft -h\n ____                __ _\n/ ___|_      _____  / _| |_\n\\___ \\ \\ /\\ / / _ \\| |_| __|\n ___) \\ V  V / (_) |  _| |_\n|____/ \\_/\\_/ \\___/|_|  \\__|\n\nUsage:\n  php bin/swoft {command} [arguments ...] [options ...]\n\nCommands:\n  entity  The group command list of database entity\n  gen     Generate some common application template classes\n  rpc     The group command list of rpc server\n  server  The group command list of http-server\n  ws      There some commands for manage the webSocket server\n\nOptions:\n  -v, --version  show version\n  -h, --help     show help\n```\n\n## HTTP Server启动\n\n\u003e 是否同时启动RPC服务器取决于.env文件配置\n\n```bash\n// 启动服务，根据 .env 配置决定是否是守护进程\nphp bin/swoft start\n\n// 守护进程启动，覆盖 .env 守护进程(DAEMONIZE)的配置\nphp bin/swoft start -d\n\n// 重启\nphp bin/swoft restart\n\n// 重新加载\nphp bin/swoft reload\n\n// 关闭服务\nphp bin/swoft stop\n```\n\n### WebSocket Server启动\n\n启动WebSocket服务器,可选是否同时支持http处理\n\n```bash\n// 启动服务，根据 .env 配置决定是否是守护进程\nphp bin/swoft ws:start\n\n// 守护进程启动，覆盖 .env 守护进程(DAEMONIZE)的配置\nphp bin/swoft ws:start -d\n\n// 重启\nphp bin/swoft ws:restart\n\n// 重新加载\nphp bin/swoft ws:reload\n\n// 关闭服务\nphp bin/swoft ws:stop\n```\n\n## RPC Server启动\n\n\u003e 启动独立的RPC服务器\n\n```bash\n// 启动服务，根据 .env 配置决定是否是守护进程\nphp bin/swoft rpc:start\n\n// 守护进程启动，覆盖 .env 守护进程(DAEMONIZE)的配置\nphp bin/swoft rpc:start -d\n\n// 重启\nphp bin/swoft rpc:restart\n\n// 重新加载\nphp bin/swoft rpc:reload\n\n// 关闭服务\nphp bin/swoft rpc:stop\n\n```\n\n# 更新日志\n\n[更新日志](changelog.md)\n\n# 协议\nSwoft 的开源协议为 Apache-2.0，详情参见[LICENSE](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flimingxinleo%2Fswoft-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flimingxinleo%2Fswoft-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flimingxinleo%2Fswoft-project/lists"}