title: How exactly is PHP creating superglobal $_POST, $_GET, $_COOKIE and $_REQUEST?
body: <p>I'm sorry for confusing title of the question, I'll try to clarify what the issue is.</p>
  
  <p>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.</p>
  
  <p>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?</p>
  
  <p>Note: I could parse the HTTP request manually and create those variables myself, but I wasn't able to find any documentation on <em>how</em> 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.</p>
  
  <p>Thank you for any input.</p>