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
$_POST, $_GET, $_COOKIE and $_REQUEST are available in PHP every time, also if php was run in command-line. These arrays are writable, you can add values to $_POST array and get one in any other places.
This code fully correct and workable if run it from console:
Result:
$_POST in global scope:
array(1) {
'test' =>
string(1) "1"
}
$_POST in function scope:
array(1) {
'test' =>
string(1) "1"
}
Others super-global array in function scope:
array(0) {
}
array(0) {
}
Also, you can create class, and save data from HttpRequest in static field of it. In this case, you can use it from anywere.