onex / sword
lumen run in swoole_http_server
0.0.3
2017-04-24 07:12 UTC
Requires
- php: >=5.6.9
- laravel/lumen-framework: >=5.2.0
This package is auto-updated.
Last update: 2024-10-23 19:55:15 UTC
README
Summary (简述)
Sword is a tool used on lumen. It allows the lumen to run in memory. Each request is only to be used for the Controller class, and no need to initialize the entire framework, which greatly improve the performance of the high performance.
Sword 是用在lumen上的一个工具。它可以使lumen常驻运行内存中。每次请求都只实例化Controller等类,而不需要初始化整个框架,从而大幅度提运行高性能。
Notice
installed
composer require onex/sword
- 复制Application.php到app目录下
copy lumen_project_dir/vendor/onex/sword/misc/Application.php lumen_project_dir/app/
- 修改 $app实例化的类
// 位于lumen_project_dir/bootstrap/app.php文件 //$app = new Laravel\Lumen\Application( // realpath(__DIR__.'/../') //); //修改为以下内容 $app = new App\Application( realpath(__DIR__.'/../') );
run
vendor/bin/sword