mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-18 20:15:14 +02:00
**refactor(dynamic): introduce framework-specific fallback logic for Quartz, Spring, Celery, Django, Express, and Socket.IO, enhance middleware/request handling and extend test coverage**
This commit is contained in:
parent
a12f7efc3a
commit
8eeb9590b4
6 changed files with 554 additions and 54 deletions
|
|
@ -3116,11 +3116,23 @@ fn emit_middleware_harness(spec: &HarnessSpec, name: &str) -> HarnessSource {
|
|||
r#"{preamble}
|
||||
echo "__NYX_MIDDLEWARE__: " . {name:?} . "\n";
|
||||
|
||||
$req = new stdClass();
|
||||
$req->body = $payload;
|
||||
$req->path = '/nyx';
|
||||
$req->method = 'POST';
|
||||
$req->query = [ 'q' => $payload ];
|
||||
function __nyx_make_middleware_request(string $payload) {{
|
||||
if (class_exists('Illuminate\\Http\\Request')) {{
|
||||
try {{
|
||||
return Illuminate\Http\Request::create('/nyx', 'POST', ['q' => $payload], [], [], [], $payload);
|
||||
}} catch (Throwable $e) {{
|
||||
fwrite(STDERR, 'NYX_LARAVEL_REQUEST_FALLBACK: ' . get_class($e) . ': ' . $e->getMessage() . "\n");
|
||||
}}
|
||||
}}
|
||||
$req = new stdClass();
|
||||
$req->body = $payload;
|
||||
$req->path = '/nyx';
|
||||
$req->method = 'POST';
|
||||
$req->query = [ 'q' => $payload ];
|
||||
return $req;
|
||||
}}
|
||||
|
||||
$req = __nyx_make_middleware_request($payload);
|
||||
$next = function ($r) {{ return $r; }};
|
||||
|
||||
if (class_exists({handler:?})) {{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue