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. 本模块默认提供一个HTTP服务和一个WebSocket服务。
  2. 基于Workerman,就像Webman也是基于它一样,但本模块的整合方式更加简洁(TP本身比Webman复杂)。
  3. 文件监听热重载支持。

HTTP服务

Windows

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

Linux/Mac

WEBSOCKET服务

Windows

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

Linux/Mac

注意:命令权限不足请自行加sudo

常驻内存须知

php cli下不支持的特性

  1. Cookie和Session:我们也建议您无必要不使用,通常无需担心。
  2. move_uploaded_file:框架的文件上传类中已经兼容rename进行上传文件的移动。
  3. header:请使用TP的return Response()->header()方案设置响应头,如果是SSE等比较特别的,请使用特定格式输出对应所需的响应头内容。

对比传统PHP应用

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

常见问题

http无法访问,ws无法连接?

创建https,wss服务?

自定义协议/服务?

模块如何监听onWorkerStart等事件?


All versions of think-worker with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0.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
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 ....