Download the PHP package lruisen/think-worker without Composer

On this page you can find all versions of the php package lruisen/think-worker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package think-worker

Thinkphp Workerman工程,让您的Thinkphp应用 常驻内存 运行!

特别鸣谢

站在巨人的肩膀上

排名不分先后

运行环境

介绍

安装扩展包

功能特性

  1. 文件监听热重载支持。
  2. 本模块默认提供HTTP服务。
  3. 提供基于 workerman/crontab 的定时任务服务
  4. 提供基于 topthink/think-queue 的一键启动队列服务
  5. 基于Workerman,就像Webman也是基于它一样「TP本身比Webman复杂」。
  6. 支持使用docker容器运行「Dockerfile文件在源码根目录」。

一键启动全部服务

独立启动HTTP服务

热更新配置在 /config/worker_process/中,APP_DEBUG = true 模式下自动开启热更新

独立启动队列服务

配置文件位于 config/worker_process 以下配置代替think-queue里的最后一步:监听任务并执行,无需另外起进程执行队列

具体配置参数请参考配置文件

独立启动定时任务服务

配置文件位于 config/worker_cron

基于workerman的定时任务程序crontab

具体配置参数请参考配置文件

支持symfony/var-dumper

中间件内容从 top-think/think-swoole 中摘抄而来

由于应用是通过php cli启动的,所以默认symfony/var-dumper会将调试信息打印在控制台, 通过配置中间件来支持将调试信息输出在网页上 如下是直接在配置在全局中间件上,也可以在路由定义的时候配置,建议是在路由定义的时候配置更加灵活

常驻内存须知

php cli下不支持的特性

  1. Cookie和Session:我们也建议您无必要不使用,通常无需担心。
  2. header:请使用TP的return Response()->header()方案设置响应头,如果是SSE等比较特别的,请使用对应特定格式输出对应所需的响应头内容。

对比传统PHP应用

  1. 常驻内存模式载入程序文件、解析等之后,并不会销毁内存中的数据,使得类的定义、全局对象、类的静态成员 不会释放! 便于后续重复利用。
  2. 避免多次require/include相同的类或者常量的定义文件。
  3. 避免使用exit、die,它们将导致子进程直接退出。
  4. 事出反常,重启服务,顺风顺水也不妨刷新再看一遍。
  5. 大多数情况下,代码在常驻内存的服务上能跑,那么php think run的服务上也能跑,可以相互映照。

常见问题

http无法访问?

创建https,wss服务?

自定义协议/服务?

模块如何监听onWorkerStart等事件?


All versions of think-worker with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
voku/anti-xss Version ^4.1
topthink/framework Version ^8.0
workerman/workerman Version ^4.1
workerman/gateway-worker Version ^3.1
topthink/think-queue Version ^3.0
workerman/crontab Version ^1.0
next/var-dumper Version ^0.1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lruisen/think-worker contains the following files

Loading the files please wait ....