public static function globals()
    {
        static $globals;
        if(!$globals) {

            $globals = new static(Uri::current());
            $globals->servers = &$_SERVER;
            $globals->envs = &$_ENV;
            $globals->values = &$_POST;
            $globals->cookies = &$_COOKIE;

            $globals->accept = Request\Accept::from(
                $globals->server('HTTP_ACCEPT'),
                $globals->server('HTTP_ACCEPT_LANGUAGE'),
                $globals->server('HTTP_ACCEPT_ENCODING'),
                $globals->server('HTTP_ACCEPT_CHARSET')
            );

            $globals->method = $globals->server('REQUEST_METHOD');
            $globals->secure = ($globals->server('HTTPS') == 'on');
            $globals->ajax = $globals->server('HTTP_X_REQUESTED_WITH')
                && strtolower($globals->server('HTTP_X_REQUESTED_WITH')) == 'xmlhttprequest';

            $globals->root = dirname($globals->server('SCRIPT_FILENAME'));
            $globals->root = rtrim($globals->root, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;

            if(function_exists('http_response_code')) {
                $globals->code = http_response_code();
            }
            if(function_exists('http_get_request_body')) {
                $globals->body = http_get_request_body();
            }
            if(function_exists('apache_request_headers')) {
                $globals->headers = apache_request_headers();
            }

            foreach($_FILES as $index => $file) {
                $globals->files[$index] = new Request\File($file);
            }

            $globals->cli = (php_sapi_name() === 'cli');
            $globals->agent = $globals->server('HTTP_USER_AGENT');
            $globals->ip = $globals->server('REMOTE_ADDR');
            $globals->time = $globals->server('REQUEST_TIME');
        }

        return $globals;
    }
public static function globals()
    {
        static $globals;
        if(!$globals) {

            $globals = new static(Uri::current());
            $globals->servers = &$_SERVER;
            $globals->envs = &$_ENV;
            $globals->values = &$_POST;
            $globals->cookies = &$_COOKIE;

            $globals->accept = Request\Accept::from(
                $globals->server('HTTP_ACCEPT'),
                $globals->server('HTTP_ACCEPT_LANGUAGE'),
                $globals->server('HTTP_ACCEPT_ENCODING'),
                $globals->server('HTTP_ACCEPT_CHARSET')
            );

            $globals->method = $globals->server('REQUEST_METHOD');
            $globals->secure = ($globals->server('HTTPS') == 'on');
            $globals->ajax = $globals->server('HTTP_X_REQUESTED_WITH')
                && strtolower($globals->server('HTTP_X_REQUESTED_WITH')) == 'xmlhttprequest';

            $globals->root = dirname($globals->server('SCRIPT_FILENAME'));
            $globals->root = rtrim($globals->root, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;

            if(function_exists('http_response_code')) {
                $globals->code = http_response_code();
            }
            if(function_exists('http_get_request_body')) {
                $globals->body = http_get_request_body();
            }
            if(function_exists('apache_request_headers')) {
                $globals->headers = apache_request_headers();
            }

            foreach($_FILES as $index => $file) {
                $globals->files[$index] = new Request\File($file);
            }

            $globals->cli = (php_sapi_name() === 'cli');
            $globals->agent = $globals->server('HTTP_USER_AGENT');
            $globals->ip = $globals->server('REMOTE_ADDR');
            $globals->time = $globals->server('REQUEST_TIME');
        }

        return $globals;
    }
public static function globals ( ) { static $ globals ; if ( ! $ globals ) { $ globals = new static ( Uri :: current ( ) ) ; $ globals -> servers = & $ _SERVER ; $ globals -> envs = & $ _ENV ; $ globals -> values = & $ _POST ; $ globals -> cookies = & $ _COOKIE ; $ globals -> accept = Request \ Accept :: from ( $ globals -> server ( 'HTTP_ACCEPT' ) , $ globals -> server ( 'HTTP_ACCEPT_LANGUAGE' ) , $ globals -> server ( 'HTTP_ACCEPT_ENCODING' ) , $ globals -> server ( 'HTTP_ACCEPT_CHARSET' ) ) ; $ globals -> method = $ globals -> server ( 'REQUEST_METHOD' ) ; $ globals -> secure = ( $ globals -> server ( 'HTTPS' ) == 'on' ) ; $ globals -> ajax = $ globals -> server ( 'HTTP_X_REQUESTED_WITH' ) && strtolower ( $ globals -> server ( 'HTTP_X_REQUESTED_WITH' ) ) == 'xmlhttprequest' ; $ globals -> root = dirname ( $ globals -> server ( 'SCRIPT_FILENAME' ) ) ; $ globals -> root = rtrim ( $ globals -> root , DIRECTORY_SEPARATOR ) . DIRECTORY_SEPARATOR ; if ( function_exists ( 'http_response_code' ) ) { $ globals -> code = http_response_code ( ) ; } if ( function_exists ( 'http_get_request_body' ) ) { $ globals -> body = http_get_request_body ( ) ; } if ( function_exists ( 'apache_request_headers' ) ) { $ globals -> headers = apache_request_headers ( ) ; } foreach ( $ _FILES as $ index => $ file ) { $ globals -> files [ $ index ] = new Request \ File ( $ file ) ; } $ globals -> cli = ( php_sapi_name ( ) === 'cli' ) ; $ globals -> agent = $ globals -> server ( 'HTTP_USER_AGENT' ) ; $ globals -> ip = $ globals -> server ( 'REMOTE_ADDR' ) ; $ globals -> time = $ globals -> server ( 'REQUEST_TIME' ) ; } return $ globals ; }
Create from global environment

@return static
Create from global environment