{"id":19756823,"url":"https://github.com/imiphp/imi-project-tcp","last_synced_at":"2026-01-29T10:55:36.862Z","repository":{"id":56900037,"uuid":"202468186","full_name":"imiphp/imi-project-tcp","owner":"imiphp","description":"这是一个 imi TCP 项目开发骨架项目，你可以基于这个项目来开发你的项目。","archived":false,"fork":false,"pushed_at":"2023-07-17T06:19:28.000Z","size":30,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"2.1","last_synced_at":"2025-10-23T20:59:28.410Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.imiphp.com/","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/imiphp.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,"governance":null}},"created_at":"2019-08-15T03:32:28.000Z","updated_at":"2024-12-16T03:20:33.000Z","dependencies_parsed_at":"2022-08-20T18:20:35.685Z","dependency_job_id":null,"html_url":"https://github.com/imiphp/imi-project-tcp","commit_stats":{"total_commits":16,"total_committers":1,"mean_commits":16.0,"dds":0.0,"last_synced_commit":"009dc4175fdb53ca22049c890c25fca91adc71ad"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/imiphp/imi-project-tcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imiphp%2Fimi-project-tcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imiphp%2Fimi-project-tcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imiphp%2Fimi-project-tcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imiphp%2Fimi-project-tcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imiphp","download_url":"https://codeload.github.com/imiphp/imi-project-tcp/tar.gz/refs/heads/2.1","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imiphp%2Fimi-project-tcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28876509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T10:31:27.438Z","status":"ssl_error","status_checked_at":"2026-01-29T10:31:01.017Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":[],"created_at":"2024-11-12T03:17:06.159Z","updated_at":"2026-01-29T10:55:36.842Z","avatar_url":"https://github.com/imiphp.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 说明\r\n\r\n这是一个 imi TCP 项目开发骨架项目，你可以基于这个项目来开发你的项目。\r\n\r\nimi 框架：\u003chttps://www.imiphp.com\u003e\r\n\r\nimi 文档：\u003chttps://doc.imiphp.com\u003e\r\n\r\n## 安装\r\n\r\n创建项目：`composer create-project imiphp/project-tcp:~2.1.0`\r\n\r\n如果你希望在 Swoole 运行 imi：`composer require imiphp/imi-swoole:~2.1.0`\r\n\r\n## 配置\r\n\r\n### 项目命名空间\r\n\r\n默认是 `ImiApp`，可以在 `composer.json` 中修改：\r\n\r\n* `autoload.psr-4.ImiApp`\r\n\r\n* `imi.namespace`\r\n\r\n然后替换代码中的命名空间即可。\r\n\r\n### 运行配置\r\n\r\n项目配置目录：`config`\r\n\r\nTCP 服务器配置目录：`TCPServer/config`\r\n\r\n## 启动命令\r\n\r\nSwoole：`vendor/bin/imi-swoole swoole/start`\r\n\r\nWorkerman：`vendor/bin/imi-workerman workerman/start`\r\n\r\n## 权限\r\n\r\n`.runtime` 目录需要有可写权限\r\n\r\n## 测试客户端\r\n\r\n`test-client` 目录中附带了测试客户端，可以用于测试。\r\n\r\n## 生产环境\r\n\r\n**关闭热更新：**`config/beans.php` 中 `hotUpdate.status` 设为 `false`\r\n\r\n生产环境建议只保留一个容器，可以提升性能，imi 官方推荐使用 **Swoole**！\r\n\r\n**移除 `imi-workerman`：**`composer remove imiphp/imi-workerman`\r\n\r\n**移除 `imi-swoole`：**`composer remove imiphp/imi-swoole`（不推荐）\r\n\r\n## 代码质量\r\n\r\n### 格式化代码\r\n\r\n内置 `php-cs-fixer`，统一代码风格。\r\n\r\n配置文件 `.php-cs-fixer.php`，可根据自己实际需要进行配置，文档：\u003chttps://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/doc/config.rst\u003e\r\n\r\n**格式化项目：** `./vendor/bin/php-cs-fixer fix`\r\n\r\n**格式化指定文件：** `./vendor/bin/php-cs-fixer fix test.php`\r\n\r\n### 代码静态分析\r\n\r\n内置 `phpstan`，可规范代码，排查出一些隐藏问题。\r\n\r\n配置文件 `phpstan.neon`，可根据自己实际需要进行配置，文档：\u003chttps://phpstan.org/config-reference\u003e\r\n\r\n**分析项目：** `./vendor/bin/phpstan`\r\n\r\n**分析指定文件：** `./vendor/bin/phpstan test.php`\r\n\r\n### 测试用例\r\n\r\n内置 `phpunit`，可以实现自动化测试。\r\n\r\n**文档：**\u003chttps://phpunit.readthedocs.io/en/9.5/\u003e\r\n\r\n**测试用例 demo：**`tests/Module/Test/TestServiceTest.php`\r\n\r\n**运行测试用例：**`composer test`\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimiphp%2Fimi-project-tcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimiphp%2Fimi-project-tcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimiphp%2Fimi-project-tcp/lists"}