I'm sorry for confusing title of the question, I'll try to clarify what the issue is.
I'm doing some work with Mongrel2 server and I'm writing a PHP handler that has access to raw HTTP request data. Because I have PHP behind Mongrel2, there is no automatic creation of $_POST, $_GET, $_COOKIE and $_REQUEST variables.
The question is - is there a way that I can send the raw HTTP request to a PHP function (or anything) that will produce the superglobal variables that are usually available when using Apache + PHP?
Note: I could parse the HTTP request manually and create those variables myself, but I wasn't able to find any documentation on how exactly PHP does this HTTP parsing and importing into superglobals. If possible, I'd like to automate this process of superglobal creation without having to parse HTTP requests myself.
Thank you for any input.