| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | <?php | |
| 2 | 2 | define('DEBUG', 'on'); | |
| 3 | - define("WEBPATH", realpath(__DIR__.'/../')); | ||
| 3 | + define("WEBPATH", realpath(__DIR__ . '/../')); | ||
| 4 | 4 | require dirname(__DIR__) . '/libs/lib_config.php'; | |
| 5 | 5 | ||
| 6 | 6 | Swoole\Config::$debug = false; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,2 +1,3 @@ | |||
| 1 | 1 | <?php | |
| 2 | + Swoole::$php->http->header('Gateway-Interface', 'PHP-5.4.6'); | ||
| 2 | 3 | echo "<h1>hello world</h1>"; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | <script> | |
| 2 | - var wsServer = 'ws://127.0.0.1:9443'; | ||
| 2 | + var wsServer = 'ws://127.0.0.1:9501'; | ||
| 3 | 3 | var websocket = new WebSocket(wsServer); | |
| 4 | 4 | websocket.onopen = function (evt) { | |
| 5 | 5 | console.log("Connected to WebSocket server."); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -369,6 +369,8 @@ function onRequest(Swoole\Request $request) | |||
| 369 | 369 | { | |
| 370 | 370 | $response = new Swoole\Response; | |
| 371 | 371 | $this->currentResponse = $response; | |
| 372 | + \Swoole::$php->request = $request; | ||
| 373 | + \Swoole::$php->response = $response; | ||
| 372 | 374 | ||
| 373 | 375 | //请求路径 | |
| 374 | 376 | if ($request->meta['path'][strlen($request->meta['path']) - 1] == '/') | |
@@ -475,6 +477,7 @@ function processDynamic(Swoole\Request $request, Swoole\Response $response) | |||
| 475 | 477 | { | |
| 476 | 478 | $request->setGlobal(); | |
| 477 | 479 | $response->head['Content-Type'] = 'text/html'; | |
| 480 | + | ||
| 478 | 481 | ob_start(); | |
| 479 | 482 | try | |
| 480 | 483 | { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments