{"id":26947439,"url":"https://github.com/lejianwen/lwf","last_synced_at":"2025-04-02T20:19:17.074Z","repository":{"id":62518239,"uuid":"87901138","full_name":"lejianwen/lwf","owner":"lejianwen","description":"一个简单的websocket框架，使用swoole制作","archived":false,"fork":false,"pushed_at":"2020-07-22T02:47:53.000Z","size":58,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-20T16:04:34.478Z","etag":null,"topics":["php","swoole","websocket"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lejianwen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-11T07:03:07.000Z","updated_at":"2021-02-02T02:49:18.000Z","dependencies_parsed_at":"2022-11-02T10:31:38.674Z","dependency_job_id":null,"html_url":"https://github.com/lejianwen/lwf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lejianwen%2Flwf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lejianwen%2Flwf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lejianwen%2Flwf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lejianwen%2Flwf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lejianwen","download_url":"https://codeload.github.com/lejianwen/lwf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246884736,"owners_count":20849554,"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","swoole","websocket"],"created_at":"2025-04-02T20:19:16.467Z","updated_at":"2025-04-02T20:19:17.069Z","avatar_url":"https://github.com/lejianwen.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 简介\n* lwf 是用[swoole](http://www.swoole.com/)开发的一款websocket框架\n* 类似mvc模式开发,让人更容易理解和使用\n# 安装\n1. composer安装\n~~~\ncomposer create-project ljw/lwf lwf --prefer-dist\n~~~\n2. git安装\n~~~\ngit clone https://github.com/lejianwen/lwf.git\n~~~\n3. 下载解压使用\n\n# 目录结构\n~~~\nlwf                     项目部署目录（或者子目录）\n├─app                   应用目录\n│  ├─controllers        控制器\n│  ├─models             模型\n│  └─tasks              任务  \n├─bootstrap             \n│  └─bootstrap.php      应用启动文件\n│\n├─common                配置文件目录\n│  └─functions.php      通用方法\n│\n├─client                客户端目录\n│  └─lwf.js             客户端js\n│\n├─config                配置文件目录\n│  ├─app.php            项目配置\n│  ├─route.php          路由配置文件\n│  ├─redis.php          redis配置\n│  ├─database.php       数据库配置文件\n│  └─swoole.php         swoole_websocket配置文件\n├─demo                  示例\n│\n├─lib                   框架系统目录\n│  ├─store              redis存储fd方式\n│  ├─traits             trait文件\n│  ├─controller.php     控制器基础类\n│  ├─task.php           任务基础类\n│  └─ ...               更多系统模块\n│\n├─runtime               系统运行目录\n│  └─logs               日志文件目录\n│\n├─server                系统运行目录\n│  └─websocket.php      websocket系统文件\n│\n├─vendor                第三方类库目录（Composer依赖库）\n├─index.php             入口文件\n├─composer.json         composer 定义文件\n├─README.md             README 文件\n└─webServer             系统启动文件\n~~~\n\n# 系统使用\n-  系统配置 `config/`\n1. websocket配置 \n`swoole.php`中,具体参考[swoole的配置](https://wiki.swoole.com/wiki/page/274.html)\n2. app配置  `app.php`\n3. 数据库配置   `database.php`\n4. redis配置  `redis.php`\n- 系统使用\n1. `php webServer start     //系统启动`\n2. `php webServer stop      //系统停止`\n3. `php webServer restart   //系统重启`\n4. 也可以在websocket连接上以后发送消息到system/{:cmd}中，具体可以查看route.php中的配置和app\\controllers\\system.php中的实现，觉得不安全也可以去掉此功能，把route中的相关路由注释掉即可\n```\n|-------|------\u003e|-------| \n|server |       |client |\n|-------|       |-------| \n```\n-----\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flejianwen%2Flwf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flejianwen%2Flwf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flejianwen%2Flwf/lists"}