Пример #1
0
function request_($override = array())
{
    static $request;
    if (!isset($request) or !empty($override)) {
        $request = array('method' => array_val($override, 'method', strtoupper(server_var('REQUEST_METHOD'))), 'path' => array_val($override, 'path', rawurldecode('/' . ltrim(webserver_specific('request_path'), '/'))), 'query' => array_val($override, 'query', $_GET), 'form' => array_val($override, 'form', $_POST), 'server_vars' => array_val($override, 'server_vars', $_SERVER), 'headers' => array_val($override, 'headers', webserver_specific('request_headers')), 'body' => array_val($override, 'body', valid_body_(file_get_contents('php://input'))));
    }
    return $request;
}
Пример #2
0
function relative_uri($path = NULL)
{
    return webserver_specific('uri', URI_RELATIVE_BASE, $path);
}
Пример #3
0
function request_()
{
    return array('method' => request_method_(server_var('REQUEST_METHOD')), 'path' => request_path_(webserver_specific('request_path')), 'query' => $_GET, 'form' => $_POST, 'server_vars' => $_SERVER, 'headers' => webserver_specific('request_headers'), 'body' => request_body_(file_get_contents('php://input')));
}