Re: [RFC][Under discussion] RFC1867 for non-POST HTTP verbs
| From: | Joanhey | Date: | Thu, 04 Jan 2024 12:08:40 +0000 |
| Subject: | Re: [RFC][Under discussion] RFC1867 for non-POST HTTP verbs | ||
| References: | 1 | Groups: | php.internals php.internals |
| Request: | Send a blank email to internals+get-122107@lists.php.net to get a copy of this message | ||
Hi
I love this RFC so we can use it from CLI-SAPI
We can't use sapi_module.read_post() from CLI.
https://github.com/joanhey/AdapterMan
This runtime use the CLI-SAPI, but this SAPI is very limited. We can use parse_str() easily for 'application/x-www-form-urlencoded' but we need to replicate in userland for 'multipart/form-data'.
https://github.com/joanhey/AdapterMan/blob/master/src/Http.php#L410-L416
https://github.com/joanhey/AdapterMan/blob/master/src/ParseMultipart.php
The CLI sapi need more access to internal PHP functions.
Amp, React, Revolt, Workerman, Adapterman, ... use only CLI-SAPI.
Also I created a issue https://github.com/php/php-src/issues/12304
Because the headers functions don't work in CLI. We can override that functions, but later we need an spiral of changes: setcookie, Session, http_response_code, ...
Best regards
Joan Miquel