{"id":13793033,"url":"https://github.com/qq8044023/taskPHP","last_synced_at":"2025-05-12T17:31:40.441Z","repository":{"id":57065327,"uuid":"87285049","full_name":"qq8044023/taskPHP","owner":"qq8044023","description":"taskPHP基于原生态php开发的定时计划任务框架,利用多进程实现任务的分配和运行,利用原生态php内存共享实现进程间通信,支持linux和windows。有较好的伸缩性、扩展性、健壮稳定性而被多家公司使用，同时也希望开源爱好者一起贡献。","archived":false,"fork":false,"pushed_at":"2019-03-21T13:06:56.000Z","size":417,"stargazers_count":254,"open_issues_count":7,"forks_count":63,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-26T08:04:36.825Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/qq8044023.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-05T08:24:49.000Z","updated_at":"2025-02-24T01:19:21.000Z","dependencies_parsed_at":"2022-08-24T07:50:07.210Z","dependency_job_id":null,"html_url":"https://github.com/qq8044023/taskPHP","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qq8044023%2FtaskPHP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qq8044023%2FtaskPHP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qq8044023%2FtaskPHP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qq8044023%2FtaskPHP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qq8044023","download_url":"https://codeload.github.com/qq8044023/taskPHP/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253787333,"owners_count":21964313,"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":[],"created_at":"2024-08-03T22:01:20.785Z","updated_at":"2025-05-12T17:31:40.153Z","avatar_url":"https://github.com/qq8044023.png","language":"PHP","funding_links":[],"categories":["类库"],"sub_categories":["任务"],"readme":"taskPHP 3.0 —— 你值得信赖的PHP定时计划任务框架\n===============\n\n## 历史版本\n--\u003e[taskPHP1.x](https://gitee.com/cqcqphper/taskPHP/tree/taskPHP/1.0)\u003cbr\u003e\n--\u003e[taskPHP2.x](https://gitee.com/cqcqphper/taskPHP/tree/taskPHP/2.1)\u003cbr\u003e\n\u003e 所有分支 [查看所有分支](https://gitee.com/cqcqphper/taskPHP/branches)\n\n## taskPHP \ntaskPHP基于php开发的定时计划任务框架,多进程实现任务的分配和运行,多种进程间通信驱动支持,支持多线程模式需要安装pthreads扩展(可选),支持linux和windows。有较好的伸缩性、扩展性、健壮稳定性而被多家公司使用，同时也希望开源爱好者一起贡献。\u003cbr\u003e\n## 项目地址\ngithub地址: https://github.com/qq8044023/taskPHP\u003cbr\u003e\ngitee地址: https://gitee.com/cqcqphper/taskPHP\u003cbr\u003e\n这两个地址都会同步更新。\n## 在线交流QQ群\n如感兴趣请加QQ群 一起探讨、完善。越多人支持,就越有动力去更新,喜欢记得右上角star哈。\u003cbr\u003e\n\u003ca target=\"_blank\" href=\"//shang.qq.com/wpa/qunwpa?idkey=2a8520f5c1518df3a796e71d8c993b2f00856a035d59ca46285c4e325116ba4d\"\u003e\u003cimg border=\"0\" src=\"//pub.idqqimg.com/wpa/images/group.png\" alt=\"taskPHP框架交流群\" title=\"taskPHP框架交流群\"\u003etaskPHP ①群:375841535（空）\u003c/a\u003e\n\n框架说明\n1. 任务多进程运行模式。\n2. 任务多线程模式,需要安装pthreads扩展(可选)。\n3. 多种进程通信方式堵塞式消息队列。\n4. 任务派发及具体任务执行不在同个进程[distribute]和[worker],windows和linux下启用入口文件[start.php],windows下可运行[windows_start.cmd]快速启动。\n5. 执行时间语法跟crontab类似,且支持秒设置。\n``` php\n   * * * * * * *    //格式 :秒 分 时 天 月 年 周\n  10 * * * * * *    //表示每一分钟的第10秒运行\n /10 * * * * * *\t//表示每10秒运行\n /1 * 15,16 * * * * //表示 每天的15点,16点的每一秒运行\n```\n6. 添加任务简单,只需编写任务类,实现任务入口run方法,详情参考examples目录内的测试任务。\n\n## 环境要求\n1. php版本\u003e= 5.5\u003cbr\u003e\n2. 开启socket扩展\u003cbr\u003e\n3. 开启pdo扩展\u003cbr\u003e\n4. 开启shmop扩展\u003cbr\u003e\n   \n## 注意事项\n1. 由于任务存在派发时间，所以任务运行的时间可能会有1-2秒的误差。\n2. 编写任务有问题或调用exit将导致后台脚本停止,需要通过远控管理器重启进程。\n3. 多线程模式运行一段时间后报错,pthreads has detected that the taskphp\\Pthread could not be started, the system lacks the necessary resources or the system-imposed limit would be exceeded in xxx\n4. 后台任务数量多或者任务运行时间很密集导致数据库链接过多没有释放,需要再任务结尾处执行数据库链接对象的close方法来关闭链接。\n5. 在windows下代码存放路径不能有空格，否则会导致进程启动不起来。php的环境变量也最好也不要有空格，如果有空格可在框架配置中定义数组项php_path='php'。\n\n## 文档列表\n--\u003e[数据库类使用教程](./src/docs/db.md)\u003cbr\u003e\n--\u003e[windows下安装php多线程扩展pthreads教程](./src/docs/thread_windows.md)\u003cbr\u003e\n--\u003e[工具类Utils使用说明](./src/docs/utils.md)\u003cbr\u003e\n--\u003e[thinkphp5.0框架的集成教程](./src/docs/thinkphp5.0.md)\u003cbr\u003e\n\n\n## 使用说明\n\n### composer安装taskphp框架:\n``` php\ncomposer require taskphp/taskphp dev-master\n```\n## 命令操作\n``` php\nstart.php  start [all|任务名]  启动 可不带参数默认all\nstart.php  start \u0026   挂载后台运行,liunx操作\nstart.php  close all 结束框架  必带参数all\n\n```\n\n### 启动程序\n``` php\n[root@FX-DEBUG taskphps]# php ./start.php start\n------------------------- taskPHP ------------------------------\ntaskPHP version:3.0      PHP version:5.5.38\nlicense1:https://github.com/qq8044023/taskPHP\nlicense2:https://gitee.com/cqcqphper/taskPHP\nstartTime:2018-04-04 10:00:50\n------------------------- taskPHP Manage  ----------------------\nhttp://ServerIp:8082\nhttp://127.0.0.1:8082\n------------------------- taskPHP PROCESS ----------------------\nlisten                      processes                     status\ndistribute                    1                          [success]\ndemo1                         1                          [success]\ndemo2                         1                          [success]\n----------------------------------------------------------------\nPress Ctrl-C to quit. Start success.\n``` \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqq8044023%2FtaskPHP","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqq8044023%2FtaskPHP","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqq8044023%2FtaskPHP/lists"}