|
...
|
...
|
@@ -2,9 +2,12 @@ |
|
|
|
|
|
|
|
namespace jytools;
|
|
|
|
|
|
|
|
require_once __DIR__ . '/func.php';
|
|
|
|
|
|
|
|
use Swoole\Http\Request;
|
|
|
|
use Swoole\Http\Response;
|
|
|
|
use Swoole\Coroutine\Http\Server;
|
|
|
|
use function jytools\output;
|
|
|
|
|
|
|
|
class SimpleServerCoroutine
|
|
|
|
{
|
|
...
|
...
|
@@ -33,15 +36,16 @@ class SimpleServerCoroutine |
|
|
|
return;
|
|
|
|
}
|
|
|
|
$requestInfo = [
|
|
|
|
'method' => $request->getMethod(),
|
|
|
|
'path' => $request->server['path_info'],
|
|
|
|
'uri' => $request->server['request_uri'],
|
|
|
|
'get' => $request->get ?: [],
|
|
|
|
'post' => $request->post ?: [],
|
|
|
|
'method' => $request->getMethod(),
|
|
|
|
'header' => $request->header ?: [],
|
|
|
|
'cookie' => $request->cookie ?: [],
|
|
|
|
'rawContent' => $request->rawContent() ?: ''
|
|
|
|
];
|
|
|
|
output($requestInfo);
|
|
|
|
$simpleRequest = new SimpleRequest($requestInfo);
|
|
|
|
$res = call_user_func($callback, $simpleRequest);
|
|
|
|
if (empty($res)) {
|
...
|
...
|
|