Re: [PHP-DEV] Ask php cli to parse HTTP request

2016-11-16 Thread Thomas Hruska
On 11/16/2016 3:50 AM, Aaron Lewis wrote: I have a file that contains a HTTP request, ``` GET /xxx.php Host: xxx Content-Type: xxx ... ``` I would like to ask PHP cli to parse the HTTP request from a file, and setup $_FILES, $_POST, $_SERVER etc. What should I do? I'm familiar with PHP extensio

Re: [PHP-DEV] Ask php cli to parse HTTP request

2016-11-16 Thread Marco Pivetta
One question then: why? Working userland impl, just use it. On 16 Nov 2016 16:01, "Aaron Lewis" wrote: > Thanks Marco. > > But I'm looking for the C implementation .. > > On Wed, Nov 16, 2016 at 8:43 PM, Marco Pivetta wrote: > > Maybe something like https://github.com/guzzle/ > psr7/blob/maste

Re: [PHP-DEV] Ask php cli to parse HTTP request

2016-11-16 Thread Aaron Lewis
Thanks Marco. But I'm looking for the C implementation .. On Wed, Nov 16, 2016 at 8:43 PM, Marco Pivetta wrote: > Maybe something like https://github.com/guzzle/psr7/blob/master/README.md? > There are additional middlewares that can extract from a request and > populate super-globals for legacy

Re: [PHP-DEV] Ask php cli to parse HTTP request

2016-11-16 Thread Marco Pivetta
Maybe something like https://github.com/guzzle/psr7/blob/master/README.md? There are additional middlewares that can extract from a request and populate super-globals for legacy app support purposes. On 16 Nov 2016 11:50, "Aaron Lewis" wrote: > I have a file that contains a HTTP request, > > ```

Re: [PHP-DEV] Ask php cli to parse HTTP request

2016-11-16 Thread Aaron Lewis
I'm referring to PHP-FPM, what about that? On Wed, Nov 16, 2016 at 7:08 PM, Joe Watkins wrote: > Morning, > > Ordinarily, we don't parse that stuff, because the server communicates via > CGI/FCGI or some other server specific interface (apache). > > The CLI server does though, I'd look there for

Re: [PHP-DEV] Ask php cli to parse HTTP request

2016-11-16 Thread Joe Watkins
Morning, Ordinarily, we don't parse that stuff, because the server communicates via CGI/FCGI or some other server specific interface (apache). The CLI server does though, I'd look there for inspiration ... there's also an HTTP parser included in there ... Cheers Joe On Wed, Nov 16, 2016 at 10:5

[PHP-DEV] Ask php cli to parse HTTP request

2016-11-16 Thread Aaron Lewis
I have a file that contains a HTTP request, ``` GET /xxx.php Host: xxx Content-Type: xxx ... ``` I would like to ask PHP cli to parse the HTTP request from a file, and setup $_FILES, $_POST, $_SERVER etc. What should I do? I'm familiar with PHP extensions, so I'm capable of modifying SAPI myself.