Overview

Namespaces

  • Docta
    • MercadoLibre
      • OAuth2
        • Client
  • GuzzleHttp
    • Cookie
    • Exception
    • Handler
    • Promise
    • Psr7
  • League
    • OAuth2
      • Client
        • Grant
          • Exception
        • Provider
          • Exception
        • Token
        • Tool
  • Psr
    • Http
      • Message

Classes

  • AppendStream
  • BufferStream
  • CachingStream
  • DroppingStream
  • FnStream
  • InflateStream
  • LazyOpenStream
  • LimitStream
  • MultipartStream
  • NoSeekStream
  • PumpStream
  • Request
  • Response
  • ServerRequest
  • Stream
  • StreamWrapper
  • UploadedFile
  • Uri
  • UriNormalizer
  • UriResolver

Traits

  • MessageTrait
  • StreamDecoratorTrait

Functions

  • build_query
  • copy_to_stream
  • copy_to_string
  • hash
  • mimetype_from_extension
  • mimetype_from_filename
  • modify_request
  • normalize_header
  • parse_header
  • parse_query
  • parse_request
  • parse_response
  • readline
  • rewind_body
  • str
  • stream_for
  • try_fopen
  • uri_for
  • Overview
  • Namespace
  • Class
  • Download

Class UriResolver

Resolves a URI reference in the context of a base URI and the opposite way.

Final
Namespace: GuzzleHttp\Psr7
Author: Tobias Schultze
Link: https://tools.ietf.org/html/rfc3986#section-5
Located at src/UriResolver.php
Methods summary
public static string
# removeDotSegments( string $path )

Removes dot segments from a path and returns the new path.

Removes dot segments from a path and returns the new path.

Parameters

$path

Returns

string

Link

http://tools.ietf.org/html/rfc3986#section-5.2.4
public static Psr\Http\Message\UriInterface
# resolve( Psr\Http\Message\UriInterface $base, Psr\Http\Message\UriInterface $rel )

Converts the relative URI into a new URI that is resolved against the base URI.

Converts the relative URI into a new URI that is resolved against the base URI.

Parameters

$base
Base URI
$rel
Relative URI

Returns

Psr\Http\Message\UriInterface

Link

http://tools.ietf.org/html/rfc3986#section-5.2
public static Psr\Http\Message\UriInterface
# relativize( Psr\Http\Message\UriInterface $base, Psr\Http\Message\UriInterface $target )

Returns the target URI as a relative reference from the base URI.

Returns the target URI as a relative reference from the base URI.

This method is the counterpart to resolve(): (string) $target === (string) UriResolver::resolve($base, UriResolver::relativize($base, $target))

One use-case is to use the current request URI as base URI and then generate relative links in your documents to reduce the document size or offer self-contained downloadable document archives. $base = new Uri('http://example.com/a/b/'); echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'. echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'. echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'. echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'.

This method also accepts a target that is already relative and will try to relativize it further. Only a relative-path reference will be returned as-is. echo UriResolver::relativize($base, new Uri('/a/b/c')); // prints 'c' as well

Parameters

$base
Base URI
$target
Target URI

Returns

Psr\Http\Message\UriInterface
The relative URI reference
MercadoLibre Provider for OAuth 2.0 Client API documentation generated by ApiGen