public function current($includeQuery = true)
    {
        $url = "";
        if (!$this->serverVars && php_sapi_name() == 'cli') {
            $url = "cli";
        } else {
            $url .= $this->currentScheme().$this->currentHost();
            $port = $this->currentPort();
            if (!in_array($port, [ false, 80])) {
                $url .= ':'.$port;
            }
            $url .= $this->currentPath();
            if ($includeQuery) {
                $query = $this->currentQuery();
                if ($query) {
                    $url .= '?'.$query;
                }
            }
        }
        return static::create($url);
    }
public function current($includeQuery = true)
    {
        $url = "";
        if (!$this->serverVars && php_sapi_name() == 'cli') {
            $url = "cli";
        } else {
            $url .= $this->currentScheme().$this->currentHost();
            $port = $this->currentPort();
            if (!in_array($port, [ false, 80])) {
                $url .= ':'.$port;
            }
            $url .= $this->currentPath();
            if ($includeQuery) {
                $query = $this->currentQuery();
                if ($query) {
                    $url .= '?'.$query;
                }
            }
        }
        return static::create($url);
    }
public function current ( $ includeQuery = true ) { $ url = "" ; if ( ! $ this -> serverVars && php_sapi_name ( ) == 'cli' ) { $ url = "cli" ; } else { $ url .= $ this -> currentScheme ( ) . $ this -> currentHost ( ) ; $ port = $ this -> currentPort ( ) ; if ( ! in_array ( $ port , [ false , 80 ] ) ) { $ url .= ':' . $ port ; } $ url .= $ this -> currentPath ( ) ; if ( $ includeQuery ) { $ query = $ this -> currentQuery ( ) ; if ( $ query ) { $ url .= '?' . $ query ; } } } return static :: create ( $ url ) ; }
Get the URL of current request.

@param bool $includeQuery <p>Include the query string in the result</p>
@return Url The URL of the current request or cli if called from the command line
Get the URL of current request .