Retrieves the content of a text document identified by the URI through a textDocument/xcontent request

@param string $uri The URI of the document
@return Promise <string> Resolved with the content as a string
176259
public function retrieve(string $uri): Promise
    {
        return $this->client->textDocument->xcontent(new TextDocumentIdentifier($uri))
            ->then(function (TextDocumentItem $textDocument) {
                return $textDocument->text;
            });
    }
763681
public function retrieve($uri)
    {
        $ch = curl_init();

        curl_setopt($ch, CURLOPT_URL, $uri);
        curl_setopt($ch, CURLOPT_HEADER, true);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: ' . Validator::SCHEMA_MEDIA_TYPE));

        $response = curl_exec($ch);
        if (false === $response) {
            throw new \JsonSchema\Exception\ResourceNotFoundException('JSON schema not found');
        }

        $this->fetchMessageBody($response);
        $this->fetchContentType($response);

        curl_close($ch);

        return $this->messageBody;
    }
1000822
public function load(string $uri): \stdClass
    {
        $response = $this->reader->read($uri);

        foreach ($this->parsers as $parser) {
            if (!$parser->canParse($response->getContentType())) {
                continue;
            }

            return $parser->parse($response->getContent());
        }

        throw new ResourceNotParsableException("No parser for response of '$uri''");
    }
326101
public function parse($uri)
    {
        // Capture scheme
        if (($scheme = static::parseScheme($uri)) !== null) {
            $this->setScheme($scheme);
            $uri = substr($uri, strlen($scheme) + 1);
        }

        // Capture authority part
        if (preg_match('|^//([^/\?#]*)|', $uri, $match)) {
            $authority = $match[1];
            $uri       = substr($uri, strlen($match[0]));

            // Split authority into userInfo and host
            if (strpos($authority, '@') !== false) {
                // The userInfo can also contain '@' symbols; split $authority
                // into segments, and set it to the last segment.
                $segments  = explode('@', $authority);
                $authority = array_pop($segments);
                $userInfo  = implode('@', $segments);
                unset($segments);
                $this->setUserInfo($userInfo);
            }

            $nMatches = preg_match('/:[\d]{1,5}$/', $authority, $matches);
            if ($nMatches === 1) {
                $portLength = strlen($matches[0]);
                $port = substr($matches[0], 1);

                $this->setPort((int) $port);
                $authority = substr($authority, 0, -$portLength);
            }

            $this->setHost($authority);
        }

        if (!$uri) {
            return $this;
        }

        // Capture the path
        if (preg_match('|^[^\?#]*|', $uri, $match)) {
            $this->setPath($match[0]);
            $uri = substr($uri, strlen($match[0]));
        }

        if (!$uri) {
            return $this;
        }

        // Capture the query
        if (preg_match('|^\?([^#]*)|', $uri, $match)) {
            $this->setQuery($match[1]);
            $uri = substr($uri, strlen($match[0]));
        }
        if (!$uri) {
            return $this;
        }

        // All that's left is the fragment
        if ($uri && substr($uri, 0, 1) == '#') {
            if ('#' === $uri) {
                $this->setFragment('');
            } else {
                $this->setFragment(substr($uri, 1));
            }
        }

        return $this;
    }
301139
public static function createFromString (string $uri)
    {
        $parts = parse_url($uri);
        $scheme = isset($parts['scheme']) ? $parts['scheme'] : '';
        $user = isset($parts['user']) ? $parts['user'] : '';
        $pass = isset($parts['pass']) ? $parts['pass'] : '';
        $host = isset($parts['host']) ? $parts['host'] : '';
        $port = isset($parts['port']) ? $parts['port'] : null;
        $path = isset($parts['path']) ? $parts['path'] : '';
        $query = isset($parts['query']) ? $parts['query'] : '';
        $fragment = isset($parts['fragment']) ? $parts['fragment'] : '';

        return new \Resilient\Http\Uri($scheme, $host, $port, $path, $query, $fragment, $user, $pass);
    }
1183271
protected function getUriInterface($uri)
    {
        if ($uri instanceof UriInterface) {
            return UriInterface::class;
        }

        if ($uri instanceof Uri) {
            return Uri::class;
        }

        throw Exception::fromInvalidUri($uri);
    }
486768
public function toRequestString(string $uri = ''): string
    {
        return !empty($this->raw) ? self::kvToRequestString($this->toRequestArray($uri)) : '';
    }
1176921
public function fetch($uri, $params)
    {
        $request =
            new PlivoRequest(
                'GET', $uri, ArrayOperations::removeNull($params));
        return $this->sendRequest($request);
    }
569668
private function requestNonce(string $uri): Promise {
        return call(function () use ($uri) {
            $request = new Request($uri, 'HEAD');

            try {
                /** @var Response $response */
                $response = yield $this->http->request($request, [
                    Client::OP_DISCARD_BODY => true,
                ]);

                if (!$response->hasHeader('replay-nonce')) {
                    throw new AcmeException("HTTP response didn't carry replay-nonce header.");
                }

                return $response->getHeader('replay-nonce');
            } catch (HttpException $e) {
                throw new AcmeException("HEAD request to {$uri} failed, could not obtain a replay nonce: " . $e->getMessage(), null, $e);
            }
        });
    }
79001
function requestURI( $uri )
    {
        $parsed = parse_url( $uri );

        $return = '';
        if ( isset( $parsed['user'] ) )
        {
            $return .= $parsed['user'] . '@' . $parsed['pass'];
        }
        $return .= rtrim( $parsed['path'], '/' ) . '/' . $this->Name;

        if ( isset( $parsed['query'] ) )
        {
            $return  .= '?' . $parsed['query'];
        }
        if ( isset( $parsed['fragment'] ) )
        {
            $return .= '#' . $parsed['fragment'];
        }

        return $return;
    }
666785
public function get(string $uri): Description
    {
        if (!$uri) {
            throw new \InvalidArgumentException("No document URI provided");
        }
        if ($this->basePath) {
            $uri = "$this->basePath/$uri";
        }
        if (!isset($this->specifications[$uri])) {
            $this->specifications[$uri] = $this->load($uri);
        }

        return $this->specifications[$uri];
    }
441298
static protected function curl ( $uri )
	{
		$ch = curl_init();

		curl_setopt($ch, CURLOPT_HTTPHEADER,	 array('Accept: application/xrds+xml, */*;q=0.1'));
		curl_setopt($ch, CURLOPT_USERAGENT,		 'anyMeta/OAuth 1.0 - (OAuth Discovery $LastChangedRevision: 45 $)');
		curl_setopt($ch, CURLOPT_URL, 			 $uri);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
		curl_setopt($ch, CURLOPT_HEADER, 		 true);
		curl_setopt($ch, CURLOPT_TIMEOUT, 		 30);

		$txt = curl_exec($ch);
		curl_close($ch);

		// Tell the logger what we requested and what we received back
		$data = "GET $uri";
		OAuthRequestLogger::setSent($data, "");
		OAuthRequestLogger::setReceived($txt);

		return $txt;
	}
910074
public static function getDomain($uri)
    {
        $returnValue = parse_url($uri, PHP_URL_HOST);
        if (empty($returnValue)) {
            return null;
        }

        return $returnValue;
    }
625297
public function fromString($uri)
    {
        if (is_numeric($uri)) { //Could be a valid url
            $uri = '' . $uri;
        }
        if (!is_string($uri)) {
            $uri = '';
        }
        $this->setRelative();
        if (0 === strpos($uri, '//')) {
            $this->setAbsolute();
        }
        $parsed_url = parse_url($uri);
        if (!$parsed_url) {
            return $this;
        }
        if (array_key_exists('scheme', $parsed_url)) {
            $this->setAbsolute();
        }
        foreach ($parsed_url as $urlPart => $value) {
            $method = 'set' . ucfirst($urlPart);
            if (method_exists($this, $method)) {
                $this->$method($value);
            }
        }
        return $this;
    }
1074123
private function base64Encode($uri) {

        if (null === $uri) {
            return null;
        }

        $splFileObject = new SplFileObject($uri);

        if (30100 < Kernel::VERSION_ID) {
            return (new DataUriNormalizer())->normalize($splFileObject);
        }

        $data = "";
        while (false === $splFileObject->eof()) {
            $data .= $splFileObject->fgets();
        }

        return sprintf("data:%s;base64,%s", mime_content_type($uri), base64_encode($data));
    }
1248735
public function parse($uri)
    {
        if (($scheme = static::parseScheme($uri)) !== null) {
            $this->setScheme($scheme);
            $uri = substr($uri, strlen($scheme) + 1);
        }

        $parts = explode(',', $uri, 2);

        if (count($parts) > 1) {
            $mimeType = array_shift($parts);
            if (';base64' === substr($mimeType, -7)) {
                $this->encoding = 'base64';
                $mimeType = substr($mimeType, 0, -7);
            }
            $this->setMimeType($mimeType);
        }

        $this->rawData = array_shift($parts);

        return $this;
    }
1103905
private function findPageByUri($uri)
    {
        $repository = $this->repository->with('images', 'documents', 'publishedSections');

        if ($uri === null) {
            return $repository->findBy('is_home', 1);
        }

        // Only locale in url
        if (
            in_array($uri, locales()) &&
            (
                config('app.fallback_locale') != $uri ||
                config('typicms.main_locale_in_url')
            )
        ) {
            return $repository->findBy('is_home', 1);
        }

        return $repository->getFirstByUri($uri);
    }