src/Http/Cgi/Request.php
public static function ingoing($config = [])
    {
        $config['env'] = isset($config['env']) ? $config['env'] : $_SERVER;

        if (!isset($config['env']['REQUEST_URI'])) {
            throw new NetException("Missing `'REQUEST_URI'` environment variable, unable to create the main request.");
        }

        if (!isset($config['env']['SCRIPT_NAME'])) {
            throw new NetException("Missing `'SCRIPT_NAME'` environment variable, unable to create the main request.");
        }

        return new static($config + [
            'body'    => new Part(['filename' => 'php://input', 'mode' => 'r']),
            'query'   => isset($_GET) ? $_GET : [],
            'cookies' => $_COOKIE
        ]);
    }
public static function ingoing($config = [])
    {
        $config['env'] = isset($config['env']) ? $config['env'] : $_SERVER;

        if (!isset($config['env']['REQUEST_URI'])) {
            throw new NetException("Missing `'REQUEST_URI'` environment variable, unable to create the main request.");
        }

        if (!isset($config['env']['SCRIPT_NAME'])) {
            throw new NetException("Missing `'SCRIPT_NAME'` environment variable, unable to create the main request.");
        }

        return new static($config + [
            'body'    => new Part(['filename' => 'php://input', 'mode' => 'r']),
            'query'   => isset($_GET) ? $_GET : [],
            'cookies' => $_COOKIE
        ]);
    }
public static function ingoing ( $ config = [ ] ) { $ config [ 'env' ] = isset ( $ config [ 'env' ] ) ? $ config [ 'env' ] : $ _SERVER ; if ( ! isset ( $ config [ 'env' ] [ 'REQUEST_URI' ] ) ) { throw new NetException ( "Missing `'REQUEST_URI'` environment variable, unable to create the main request." ) ; } if ( ! isset ( $ config [ 'env' ] [ 'SCRIPT_NAME' ] ) ) { throw new NetException ( "Missing `'SCRIPT_NAME'` environment variable, unable to create the main request." ) ; } return new static ( $ config + [ 'body' => new Part ( [ 'filename' => 'php://input' , 'mode' => 'r' ] ) , 'query' => isset ( $ _GET ) ? $ _GET : [ ] , 'cookies' => $ _COOKIE ] ) ; }
Creates a request extracted from CGI globals.

@param  array $config The config array.
- `'env'`     _array_: Environment variable (defaults: `$_SERVER`).
@return self
Creates a request extracted from CGI globals .