Get the URI for an AJAX Request.

@return string the AJAX URI
@throws WidgetContextNotFoundException
506470
protected function getAjaxUri()
    {
        $action = $this->arguments['action'];
        $arguments = $this->arguments['arguments'];

        if ($action === null) {
            $action = $this->controllerContext->getRequest()->getControllerActionName();
        }
        $arguments['@action'] = $action;
        if (strlen($this->arguments['format']) > 0) {
            $arguments['@format'] = $this->arguments['format'];
        }
        /** @var $widgetContext WidgetContext */
        $widgetContext = $this->controllerContext->getRequest()->getInternalArgument('__widgetContext');
        if ($widgetContext === null) {
            throw new WidgetContextNotFoundException('Widget context not found in <f:widget.uri>', 1307450639);
        }
        if ($this->arguments['includeWidgetContext'] === true) {
            $serializedWidgetContext = base64_encode(serialize($widgetContext));
            $arguments['__widgetContext'] = $this->hashService->appendHmac($serializedWidgetContext);
        } else {
            $arguments['__widgetId'] = $widgetContext->getAjaxWidgetIdentifier();
        }
        return '?' . http_build_query($arguments, null, '&');
    }
586636
private function locateURI() : string
    {
        $this->page_uri = filter_input(
            INPUT_GET,
            NABU_PATH_PARAM,
            FILTER_SANITIZE_STRING,
            FILTER_FLAG_EMPTY_STRING_NULL
        );

        if (!is_string($this->page_uri) || strlen($this->page_uri) === 0) {
            $this->page_uri = $this->nb_application->getHTTPServer()->getRequestURI();
        }

        if (!is_string($this->page_uri) || strlen($this->page_uri) === 0) {
            throw new ENabuCoreException(ENabuCoreException::ERROR_PAGE_URI_NOT_FOUND);
        }

        CNabuEngine::getEngine()->traceLog("Page requested", $this->page_uri);

        return $this->page_uri;
    }
107894
public function getUri()
    {
        if (!$this->_uri instanceof UriInterface) {
            if ($this->_uri === null) {
                $uri = new Uri(['string' => $this->getAbsoluteUrl()]);
            } elseif ($this->_uri instanceof \Closure) {
                $uri = call_user_func($this->_uri, $this);
            } else {
                $uri = $this->_uri;
            }

            $this->_uri = Instance::ensure($uri, UriInterface::class);
        }
        return $this->_uri;
    }
601448
public function getCurrentUri() : string
    {
        $basePath = $this->getBaseUrl();
        $uri = $this->currentUrl;

        $this->base = $basePath;
        $uri = substr($uri, strlen($basePath));

        // 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
        $uri = '/'.trim($uri, '/');

        return $uri;
    }
542381
public function getUri(): string
    {
        $configuration = GeneralUtility::makeInstance(ConfigurationService::class);

        // Find host-name / IP, always in lowercase:
        $isHttp = (0 === \mb_strpos(GeneralUtility::getIndpEnv('TYPO3_REQUEST_HOST'), 'http://'));
        $uri = GeneralUtility::getIndpEnv('REQUEST_URI');
        if ($configuration->isBool('recreateURI')) {
            $uri = $this->recreateUriPath($uri);
        }

        $uri = ($isHttp ? 'http://' : 'https://') . \mb_strtolower(GeneralUtility::getIndpEnv('HTTP_HOST')) . '/' . \ltrim($uri, '/');

        try {
            $idnaConverter = GeneralUtility::makeInstance(IdnaConvert::class);

            return $idnaConverter->encode($uri);
        } catch (\InvalidArgumentException $exception) {
            // The URI is already in puny code (no logging needed)
            return $uri;
        }
    }
344903
protected function getRequestUri()
    {

        if (!$this->requestUri) {
            $this->requestUri = rtrim($this->endpointUri, '/') . '/' . $this->version;
        }

        return $this->requestUri;

    }
407557
public function getUri()
    {
        if ( $this->hasChildren() )
        {
            foreach( $this->getChildren() as $child )
            {
                $uri = $child->getUri();

                if ( '#' != $uri[0] )
                {
                    return $uri;
                }
            }
        }
        else
        {
            return '#';
        }
    }
1025992
public function getSeoUri()
    {
        if ( ! empty( $this->_seoUri ) )
        {
            return $this->_seoUri;
        }

        if ( empty( $this->id ) )
        {
            return '';
        }

        if ( empty( $this->_seoUri ) )
        {
            $this->_seoUriStructure = $this->getUriStructure( array(
                $this->getMapper()
                     ->getLocale()
            ) );

            if ( ! empty( $this->_seoUriStructure ) )
            {
                $this->_seoUri = $this->_seoUriStructure->uri;
            }
        }

        return $this->_seoUri;
    }
475356
public function getUri()
    {
        $uri = trim($this->getRawUri());

        // absolute URL?
        if (null !== parse_url($uri, PHP_URL_SCHEME)) {
            return $uri;
        }

        // empty URI
        if (!$uri) {
            return $this->currentUri;
        }

        // an anchor
        if ('#' === $uri[0]) {
            return $this->cleanupAnchor($this->currentUri).$uri;
        }

        $baseUri = $this->cleanupUri($this->currentUri);

        if ('?' === $uri[0]) {
            return $baseUri.$uri;
        }

        // absolute URL with relative schema
        if (0 === strpos($uri, '//')) {
            return preg_replace('#^([^/]*)//.*$#', '$1', $baseUri).$uri;
        }

        $baseUri = preg_replace('#^(.*?//[^/]*)(?:\/.*)?$#', '$1', $baseUri);

        // absolute path
        if ('/' === $uri[0]) {
            return $baseUri.$uri;
        }

        // relative path
        $path = parse_url(substr($this->currentUri, strlen($baseUri)), PHP_URL_PATH);
        $path = $this->canonicalizePath(substr($path, 0, strrpos($path, '/')).'/'.$uri);

        return $baseUri.('' === $path || '/' !== $path[0] ? '/' : '').$path;
    }
561961
protected function detectBaseUri()
    {
        $baseUri = clone $this->uri;
        $baseUri = $baseUri->withQuery('')->withFragment('')->withPath(RequestInformationHelper::getScriptRequestPath($this));

        return $baseUri;
    }
599898
public static function GetRequestUrl () {
		$action_url = '/';
		if (Environment::IsCli()) {
			$argv = $_SERVER['argv'];
			array_shift($argv);
			if (!isset($argv[0])) {
				throw new \Exception('URLが設定されていません。');
			}
			$action_url = $argv[0];
		} else {
			$request_uri = Environment::IsCli() ? (Cli::GetRequestParameterList()[0] ?? '') : $_SERVER['REQUEST_URI'];
			$path_info = parse_url(sprintf('http://localhost%s', $request_uri), \PHP_URL_PATH);
			if (preg_match("@\?([^\?&=]+)(?:&|$)@", $path_info, $mat)) {
				$action_url = $mat[1];
			} else {
				$action_url = substr($path_info, strlen(dirname($_SERVER['SCRIPT_NAME'])));
				if (substr($action_url, 0, 1) !== '/') {
					$action_url = '/' . $action_url;
				}
			}
		}

		return $action_url;
	}
836103
private function getUri()
    {
        if (empty($this->uri) && ($this->uri !== false)) {
            $this->uri = $_SERVER['REQUEST_URI'];

            // Remove the parameters from the URI.
            $paramsStart = strpos($this->uri, '?');
            if ($paramsStart !== false) {
                $this->uri = substr($this->uri, 0, $paramsStart);
            }
        }

        return $this->uri;
    }
293630
public static function URI(){
    switch(true){
      case !empty($_SERVER['REQUEST_URI']):    $serv_uri = $_SERVER['REQUEST_URI']; break;
      case !empty($_SERVER['ORIG_PATH_INFO']): $serv_uri = $_SERVER['ORIG_PATH_INFO']; break;
      case !empty($_SERVER['PATH_INFO']):      $serv_uri = $_SERVER['PATH_INFO']; break;
      default:                                 $serv_uri = '/'; break;
    }
    $uri = rtrim(strtok($serv_uri,'?'),'/') ?: '/';
    return Filter::with('core.request.URI', $uri) ?: '/';
  }
699819
protected function getWidgetUri()
    {
        $uriBuilder = $this->controllerContext->getUriBuilder();
        $argumentPrefix = $this->controllerContext->getRequest()->getArgumentPrefix();
        $arguments = $this->hasArgument('arguments') ? $this->arguments['arguments'] : [];
        if ($this->hasArgument('action')) {
            $arguments['action'] = $this->arguments['action'];
        }
        if ($this->hasArgument('format') && $this->arguments['format'] !== '') {
            $arguments['format'] = $this->arguments['format'];
        }
        if ($this->hasArgument('addQueryStringMethod') && $this->arguments['addQueryStringMethod'] !== '') {
            $arguments['addQueryStringMethod'] = $this->arguments['addQueryStringMethod'];
        }
        $uriBuilder->reset()
            ->setArguments([$argumentPrefix => $arguments])
            ->setSection($this->arguments['section'])
            ->setAddQueryString(true)
            ->setArgumentsToBeExcludedFromQueryString([$argumentPrefix, 'cHash'])
            ->setFormat($this->arguments['format']);

        // TYPO3 6.0 compatibility check:
        if (method_exists($uriBuilder, 'setAddQueryStringMethod')) {
            $uriBuilder->setAddQueryStringMethod($this->arguments['addQueryStringMethod']);
        }

        return $uriBuilder->build();
    }
1211491
protected function getContextID() {
		$result = (int)$this->request->param('Action');
		if ($result) {
			return $result;
		}
		return (int)$this->request->param('ID');
	}
947314
public function getUri()
    {
        if (!$this->uri)
            $this->uri = new Uri($this->httpMessage->getTarget());
        
        return $this->uri;
    }
1103224
private function getUri(): UriInterface
    {
        $uri = $this->getNewUri();

        if (!empty($this->apiUrl['scheme'])) {
            $uri = $uri->withScheme($this->apiUrl['scheme']);
        }

        if (!empty($this->apiUrl['host'])) {
            $uri = $uri->withHost($this->apiUrl['host']);
        }

        if (!empty($this->apiUrl['port'])) {
            $uri = $uri->withPort($this->apiUrl['port']);
        }

        if (!empty($this->apiUrl['path'])) {
            $uri = $uri->withPath($this->apiUrl['path']);
        }

        if (!empty($this->apiUrl['query'])) {
            $uri = $uri->withQuery($this->apiUrl['query']);
        }

        if (!empty($this->apiUrl['fragment'])) {
            $uri = $uri->withFragment($this->apiUrl['fragment']);
        }

        return $uri;
    }