shopex / sword by bryantyan

lumen run in swoole_http_server
610
7
10
Package Data
Maintainer Username: bryantyan
Maintainer Contact: elrondgcn@gmail.com (Elrond G)
Package Create Date: 2016-07-28
Package Last Update: 2017-04-24
Language: PHP
License: BSD-3-Clause
Last Refreshed: 2024-11-23 03:14:01
Package Statistics
Total Downloads: 610
Monthly Downloads: 2
Daily Downloads: 0
Total Stars: 7
Total Watchers: 10
Total Forks: 4
Total Open Issues: 1

sword

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

config