Request path without the query string.
The application's basePath is included.

@return string
334207
public function originalPath()
    {
        if (is_int($pos = strpos($this->getParam('REQUEST_URI'), '?'))) {
            return substr($this->getParam('REQUEST_URI'), 0, $pos);
        }
        return substr($this->getParam('REQUEST_URI'), 0);
    }
1177627
public function basePath()
    {
        if ($this->dirname && $this->basename) {
            return ($this->dirname .'/'. $this->basename);
        }

        return null;
    }
860526
public function requestPath()
    {
        if($this->shopURL != null)
            $this->requestPath = 'https://' . $this->shopURL . $this->adminPath;

        return $this->requestPath;
    }
845628
public function getPath()
    {
        $pathInfo = rawurldecode($this->getPathInfo());
        $path = '/' . trim($pathInfo, '/');

        return ($path == '/') ? '' : $path;
    }
918305
public function getBasePath()
    {
        if ($this->basePath === null) {
            $this->setBasePath($this->detectBasePath());
        }

        return $this->basePath;
    }
1315040
public static function getBasicPath() {
        $s = &$_SERVER;
        $ssl = (!empty($s['HTTPS']) && $s['HTTPS'] == 'on') ? true : false;
        $sp = strtolower($s['SERVER_PROTOCOL']);
        $protocol = substr($sp, 0, strpos($sp, '/')) . (($ssl) ? 's' : '');
        $port = $s['SERVER_PORT'];
        $port = ((!$ssl && $port == '80') || ($ssl && $port == '443')) ? '' : ':' . $port;
        $host = isset($s['HTTP_X_FORWARDED_HOST']) ? $s['HTTP_X_FORWARDED_HOST'] : (isset($s['HTTP_HOST']) ? $s['HTTP_HOST'] : null);
        $host = isset($host) ? $host : $s['SERVER_NAME'] . $port;
        $uri = $protocol . '://' . $host;
        return $uri;
    }
1035014
public function getPath()
    {
        if ($this->requestTarget === null) {
            return $this->uri->getPath();
        }

        list($path) = explode('?', $this->requestTarget);

        return $path;
    }
621705
protected function getCurrentUri()
  {
    // Get the current Request URI and remove rewrite base path from it (= allows one to run the router in a sub folder)
    $uri = substr($_SERVER['REQUEST_URI'], strlen($this->getBasePath()));
    // Don't take query params into account on the URL
    if (strstr($uri, '?')) {
      $uri = substr($uri, 0, strpos($uri, '?'));
    }
    // Remove trailing slash + enforce a slash at the start
    return '/' . trim($uri, '/');
  }
480191
public function pathname()
    {
        $uri = $this->uri();

        // Strip the query string from the URI
        $uri = strstr($uri, '?', true) ?: $uri;

        return $uri;
    }
64569
public function getBasePath() {
    	
    	return ((isset($this->config['General']['base_path']) 
            && $this->config['General']['base_path'] 
            && isset($this->config['General']['use_base_path']) 
            && $this->config['General']['use_base_path']) 
                ? $this->config['General']['base_path'] : null);
    }
39759
protected function detectBasePath()
    {
        $request = Rails::application()->dispatcher()->request();
        
        $baseUrl        = '';
        $filename       = $request->get('SCRIPT_FILENAME');
        $scriptName     = $request->get('SCRIPT_NAME');
        $phpSelf        = $request->get('PHP_SELF');
        $origScriptName = $request->get('ORIG_SCRIPT_NAME');

        if ($scriptName !== null && basename($scriptName) === $filename) {
            $baseUrl = $scriptName;
        } elseif ($phpSelf !== null && basename($phpSelf) === $filename) {
            $baseUrl = $phpSelf;
        } elseif ($origScriptName !== null && basename($origScriptName) === $filename) {
            $baseUrl = $origScriptName;
        } else {
            $baseUrl  = '/';
            $basename = basename($filename);
            if ($basename) {
                $path     = ($phpSelf ? trim($phpSelf, '/') : '');
                $baseUrl .= substr($path, 0, strpos($path, $basename)) . $basename;
            }
        }

        $requestUri = $request->get('REQUEST_URI');

        if (0 === strpos($requestUri, $baseUrl)) {
            return $baseUrl;
        }

        $baseDir = str_replace('\\', '/', dirname($baseUrl));
        if (0 === strpos($requestUri, $baseDir)) {
            return $baseDir;
        }

        $truncatedRequestUri = $requestUri;

        if (false !== ($pos = strpos($requestUri, '?'))) {
            $truncatedRequestUri = substr($requestUri, 0, $pos);
        }

        $basename = basename($baseUrl);

        if (empty($basename) || false === strpos($truncatedRequestUri, $basename)) {
            return '';
        }
        
        if (strlen($requestUri) >= strlen($baseUrl)
            && (false !== ($pos = strpos($requestUri, $baseUrl)) && $pos !== 0)
        ) {
            $baseUrl = substr($requestUri, 0, $pos + strlen($baseUrl));
        }

        return $baseUrl;
    }
211315
private function getCurrentUrlPath()
    {
        if ($this->path) {
            return $this->path;
        }

        /**
         * check if the path is empty otherwise
         * set it with the server variable and if there's no server variable set it as the default delimiter [/] the root
         */
        $this->path = !empty($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : null;
        $this->urlPart = $this->parsePath($this->path);

        return $this->path;
    }
8878
public function getUri()
    {
        if (null !== $qs = $this->getQueryString()) {
            $qs = '?' . $qs;
        }
        return $this->getSchemeAndHttpHost() . $this->getBaseUrl() . $this->getRequest()->getPathInfo() . $qs;
    }
550675
public function getBasePath()
    {
        if (null == $this->basePath) {
            $this->basePath = strtolower($this->controllerName);
        }
        return $this->basePath;
    }
1228018
public function getRouteURL()
    {
        if (empty($this->routeUrl)) {
            $param = trim(Server::get('REQUEST_URI'), '/');

            // strip base directory from request url
            $base_dir = $this->getBaseDir();
            $param = substr($param, strlen($base_dir));

            // Strip query string (?a=b) from Request Url
            $path = trim(explode('?', $param)[0], '/');
            $this->routeUrl = strtolower($path);

            if (empty($this->routeUrl)) {
                $this->routeUrl = '/';
            }
        }

        return $this->routeUrl;
    }
990578
public function baseUrl()
    {
        if (!$this->baseUrl) {
            $this->baseUrl = $this->request->getScheme()
                . '://' . $this->request->getHttpHost();
        }
        return $this->baseUrl;
    }
591467
public String getRequestPath() {
        Map<String,String> requestHeaders = getRequestHeaders();
        if (requestHeaders == null)
            return null;
        String path = requestHeaders.get(Listener.METAINFO_REQUEST_PATH);
        return path.startsWith("/") ? path : "/" + path;
    }