Download the PHP package frenzzy-ekb/codeigniter-swoole without Composer
On this page you can find all versions of the php package frenzzy-ekb/codeigniter-swoole. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download frenzzy-ekb/codeigniter-swoole
More information about frenzzy-ekb/codeigniter-swoole
Files in frenzzy-ekb/codeigniter-swoole
Package codeigniter-swoole
Short Description A swoole adapter for Codeigniter 3.0+
License MIT
Homepage https://github.com/frenzzy-ekb/codeigniter-swoole
Informations about the package codeigniter-swoole
Codeigniter Swoole Adapter
You want long-run task? timers? FPM to CLI? Code reusing in both FPM & CLI mode?
"It's so easy!"
This adapter would make it so easy to using swoole within Codeigniter framework.
With this adapter, you can start a task(CLI) any where(FPM) you want from your code.
That's means you can start a CLI task from a FPM process.
Install
How to
- first, of course you must install
codeigniter-swoole
to your codeigniter project. - (this step is option) copy these two config files
swoole.php
andtimers.php
fromsrc/Helper
to yourapplication/config
folder. - start swoole server
php index.php swoole/server/start
- you can use
\CiSwoole\Core\Client::send($data)
to start a task now! - there's no step 5.
What is a task?
A task is just a method of your codeigniter controlloer, so almost any controller method can be used as a task.
Let's see the code
The route
is used for find which method to be call as a task, and params
is the parameters array that you may want to pass to the task.
fd
and callback
params are used to notify about task errors.
So, that's all of it!
Server CLI Commands
A little more
The step 2 copied files were config files for this adapter.
swoole.php
file can set host, port, log file and so on.
timers.php
file can set some timer methods for swoole server, these timers will be started once the server inited.
You can copy tests/application
to your application
for testing. The demos are same as below shows.
License
This project is licensed under the MIT license.
All versions of codeigniter-swoole with dependencies
ext-swoole Version ^4.0.0