Download the PHP package chenjiabin/think5.0-swoole without Composer

On this page you can find all versions of the php package chenjiabin/think5.0-swoole. 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 think5.0-swoole

ThinkPHP 5.0 Swoole 扩展

参考官方think-swoole2.0和easyswoole开发基于TP5.0的swoole扩展包

增加异步任务投递 QQ499873958

配置文件

第三方包的配置文件必须在application/extra下,文件名为swoole.php

注意:\think\Request 增加如下静态方法。 由于TP运行在Apache或者NGINX下,是每次请求后都会销毁,所以这里的单例并不会造成什么问题,但是在Swoole下,由于常驻内存,所以请求单例一旦实例化则不会改变,所以这里就将其删除,每次请求后重新实例化

目前TP官方已经支持如下方法,已经不需要修改,但目前尚未合并到5.0分支,如需要可以下载官方master分支

修改如下代码,由于采用命令行模式运行无论什么请求都会被认为是get

启动命令

守护启动

停止服务

Demo

定时器

如下是定时器接口的实现

只需要在定时器配置中配置定时任务的时间

同时定时任务支持在任务进程执行

不建议在任意进程随意使用定时器,建议使用系统配置的定时器,请注意自定义定时器使用和销毁

系统配置的定时器,在第一个worker创建一个定时器,根据任务是否到期需要执行来进行异步任务投递,并不是对当前进程造成阻塞 但是需要配置task_work_num

----------------------2018-08-24-------------------------

和think-swoole 官方统一类的命名空间

xavier-swoole会和官方think-swoole保持同步更新

接口文件统一存放在 xavier\swoole\template命名空间下

自定义服务启动

该方法等同于swoole onWorkerStart

使用方法

在swoole.php中配置

//闭包方式

基于SwooleTable的高速跨进程缓存,只需要更改如下配置,Cache即可变身高速缓存

手册 https://www.kancloud.cn/xavier007/xavier_swoole


All versions of think5.0-swoole with dependencies

PHP Build Version
Package Version
Requires ext-swoole Version >=1.8
guzzlehttp/guzzle Version ~6.2.1
jeremeamia/superclosure Version ^2.4
xavier/xcron-expression Version ^0.11
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 chenjiabin/think5.0-swoole contains the following files

Loading the files please wait ....